Hi,
You don't really need code as complicated as mine if you don't require the 100% height or the equalising columns. You van just use the basic 3 float technique as follows.
Code:
<!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">
<head>
<title>3 col layout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body {
padding:0;
margin:0;
background:#fff;
color: #000;
}
#outer{
background:#F8E7EC;
border-left:1px solid #000;
border-right:1px solid #000;
color: #000;
background:pink;
}
#header{
height:70px;
background:#FF0000;
border-top:1px solid #000;
border-bottom:1px solid #000;
color: #000000;
margin:0;
padding:0;
}
#left {
position:relative;
width:20%;
float:left;
background:orange;
}
#right {
position:relative;
width:19.9%;/*avoid rounding bug */
float:right;
background:orange;
}
.inner,.innerr{
width:97%;
border:1px solid #000;
background:silver;
margin-bottom:10px;
min-height:200px;
}
.innerr{float:right}
* html .inner, * html .innerr{height:200px}
#footer {
clear:both;
height:50px;
border-top:1px solid #000;
border-bottom:1px solid #000;
background-color: #FF8080;
color: #000;
text-align:center;
position:relative;
}
* html #footer {/*only ie gets this style*/
\height:52px;/* for ie5 */
he\ight:50px;/* for ie6 */
}
#centrecontent {
width:60%;
float:left;
}
p {margin-top:0;padding-top:0}
</style>
</head>
<body>
<div id="outer">
<h1 id="header">Header</h1>
<div id="left">
<div class="inner">This is the inner</div>
<div class="inner">This is the inner</div>
</div>
<div id="centrecontent">
<p> centre content goes here : centre content goes here : centre content goes
here : centre content goes here : centre content goes here : centre content
goes here : centre content goes here : centre content goes here : centre
content goes here : centre content goes here : centre content goes here
: centre content goes here : centre content goes here : centre content goes
here : centre content goes here : centre content goes here : centre content
goes here : centre content goes here : centre content goes here : centre
content goes here : centre content goes here : </p>
</div>
<div id="right">
<div class="innerr">This is the inner</div>
<div class="innerr">This is the inner</div>
</div>
<div id="footer">Footer </div>
</div>
</body>
</html>
With fluid sides you will have to make sure that you don't put large images in the columns as this will stop them contracting and then the floats may drop below in ie. Fluid columns like this are best for textual content and small images that can float around.
Paul
Bookmarks