Content floats left, side bar floats right : Siderbar : CSS Controls HTML CSS TUTORIALS


HTML CSS TUTORIALS » CSS Controls » Siderbar »

 

Content floats left, side bar floats right


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title></title>
  <style type="text/css" media="screen">
  #header {
    background: #ccc;
    padding: 20px;
  }
  
  #content {
    float: left;
    width: 66%;
  }
  
  #sidebar {
    float: right;
    width: 30%;
    background: #999;
  }
  
  #footer {
    clear: both;
    background: #eee;
    padding: 20px;
  }
  
  </style>
</head>
<body>

<div id="header">
<strong>HEADER</strong>
</div>

<div id="content">
<p><strong>CONTENT</strong>This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. </p>

<p>This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
This is a test. This is a test. This is a test. 
</p>
</div>

<div id="sidebar">
<p><strong>SIDEBAR</strong></p>
<ul>
<li><a href="#">Link Item 1</a></li>
<li><a href="#">Link Item 2</a></li>
<li><a href="#">Link Item 3</a></li>
<li><a href="#">Link Item 4</a></li>
</ul>
</div>

<div id="footer">
<strong>FOOTER</strong>
</div>
</body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo CSS Controls
» Siderbar