Multiple Columns : CSS Basics « Style Basics « HTML / CSS






Multiple Columns

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
  <head>
    <title>Multiple Columns</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type='text/css'>
body {
  margin: 0;
  padding: 50px;
  background-color: #FFFFFF;
  color: #000000;
  font-family: Georgia, Times, serif;
}
.wrapper {
  width: 80%;
}

.col1, .col2, .col3 {
  width: 30%;
  float: left;
  margin-right: 2%;
}
</style>

  </head>
  <body>
    <div class="wrapper">
      <div class="col1">
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce porttitor porta magna. Duis sed tortor. Aliquam sodales, augue non laoreet aliquet, ipsum risus placerat nibh, id faucibus dolor enim in justo. Nullam pulvinar nisl viverra risus dapibus cursus.</p>
      
        <p>Aliquam tristique tristique massa. Proin ipsum felis, aliquam eu, facilisis vel, condimentum non, ante. Vivamus eu magna. Vivamus a lorem. Donec vestibulum elementum urna. Aenean convallis luctus lacus. </p>
      </div>
      <div class="col2">
        <p>Ut tincidunt turpis quis sem. Pellentesque arcu urna, molestie at, dapibus at, pellentesque id, dui. Sed ut lacus. Integer vitae mi sed lacus malesuada tincidunt. Sed metus nunc, cursus nec, interdum et, condimentum a, erat. Aliquam orci neque, volutpat id, dapibus sit amet, pulvinar et, eros. Nulla facilisi. Etiam egestas aliquet nibh. Pellentesque blandit nulla ut tellus. Curabitur a quam. Sed pellentesque, neque ac iaculis congue, sapien est convallis nibh, eget posuere eros leo quis mauris.</p>
      </div>
      <div class="col3">
        <p> Sed ullamcorper, elit eget dignissim blandit, mauris leo fermentum ipsum, ut rhoncus est risus a libero. In nulla ipsum, aliquam sit amet, mattis nec, egestas et, neque. Integer egestas. In hac habitasse platea dictumst. Pellentesque vitae arcu. Aliquam eu ligula. Curabitur euismod blandit metus. Suspendisse sem. Donec sollicitudin interdum risus. Nunc feugiat, velit non sodales dictum, felis magna hendrerit lorem, et fringilla ante leo nec neque. Ut non libero. Donec eget massa. Nam eget est et nisl vestibulum iaculis.</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.Whitespace and Chunking