Whitespace and Chunking : CSS Basics « Style Basics « HTML / CSS






Whitespace and Chunking

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Whitespace and Chunking</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <style type="text/css">
    * {font-family:arial, verdana, sans-serif;}

  .section {
    width:350px; float:left;
    margin:30px; 
    border-top:1px solid #666666;
    border-bottom:1px solid #666666;}

  h3 {font-size:18px;font-weight:bold;}
  p {font-size:12px;}

    .compressed h3 {
    margin:0px 0px 0px 0px;}
    .compressed p {
    margin:0px 0px 0px 0px;}

    .spaced h3 {
    margin:24px 0px 0px 0px;}
    .spaced p {
    margin:0px 0px 18px 0px;
    line-height:1.5em;}

  </style>

</head>

<body>

  <div class="section compressed">
    <h3>Heading for first point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for second point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for third point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  </div>

  <div class="section">
    <h3>Heading for first point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for second point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for third point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  </div>

  <div class="section spaced">
    <h3>Heading for first point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for second point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  <h3>Heading for third point</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam commodo convallis sem accumsan blandit. </p>
  </div>

</div>

</body>
</html>

   
  








Related examples in the same category

1.Using Whitespace in CSS
2.Cascaded
3.css box model
4.HTML and CSS coding for inline-block elements
5.CSS Text Properties Example
6.Zero page gutter
7.Inline HTML elements include markup for explicit semantic purposes:
8.CSS can be used to control the presentation of an XHTML document
9.Box Model Demonstration
10.Width and height
11.Default Styles
12.horizontally stretching content
13.stretching content
14.Box model properties are always specified in order clockwise.
15.vertically stretching content
16.Update text color when mouse hover
17.Multiple Columns