fixed width float and clear : fixed width layout « Layout « HTML / CSS

HTML / CSS » Layout » fixed width layout 
fixed width float and clear
 

<!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">
<head>
<title>Fixed Width Layout - fixed height</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
  margin: 0;
  padding: 0;
  text-align: center;
  background: #f0f0f0;
}

#wrapper {
  text-align: left;
  width: 770px;
  margin: 10px auto auto;
  background: #dade75;
  border: 1px solid silver;
}

#header {
  background: #272727;
  padding: 10px 15px 10px 13px;
}

#content-wrapper {
  width: 570px;
  float: right;
  background: #fff;
}

#content-inner {
  padding: 5px 15px 0 15px;
}

#navigation {
  width: 200px;
  float: left;
  padding-top: 15px;
}

#footer {
  clear: both;
}
</style>
</head>

<body>

<div id="wrapper">

<div id="header">this is a test. </div>

<div id="content-wrapper">
 <div id="content-inner">
 <p>this is a test. this is a test. this is a test. this is a test. </p>
 </div>
</div>

<div id="navigation">
 <ul>
  <li><a href="">Day </a></li>
  <li><a href="">Day </a></li>
  <li><a href="">Day </a></li>
  <li><a href="">Day </a></li>
  <li><a href="">Day </a></li>
 </ul>
</div>

<div id="footer"></div>

</div>
</body>
</html>

 
Related examples in the same category
1.Fixed Width Layout - Left column not stretching
2.Fixed Width Layout - Fixed height to solve left column problem
3.Fixed Width Layout - Outer container collapsed
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.