Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example Page</title>
<style type="text/css">
#wrap_index {
border:5px dotted black;
}
#col1 {
background-color:#36F;
width:200px;
height:300px;
float:left;
}
#col2 {
background-color:#6C6;
margin:0px 210px 0px 200px;
height:200px;
}
#col3 {
background-color:#C06;
width:210px;
float:right;
}
#footer {
background-color:#CCC;
clear:both;
}
</style>
<body>
<div><h1>Example Page</h1></div>
<div id="wrap_index">
<div id="col1">
<h4>Column 1</h4>
</div>
<div id="col2">
<h4>Column 2</h4>
</div>
<div id="col3">
<h4>Column 3</h4>
</div>
</div>
<div id="footer">
<h4>Footer</h4>
</div>
</body>
</html>
Since the two outer columns are floated to the left and right, in my experience, they should be ignored by the wrapper and its content and always fall right at the top of their containing box element. Maybe I'm over thinking the problem. Anyone have a solution?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example Page</title>
<style type="text/css">
#wrap_index {
border:5px dotted black;
}
#col1 {
background-color:#36F;
width:200px;
height:300px;
float:left;
}
#col2 {
background-color:#6C6;
margin:0;
height:200px;
}
#col3 {
background-color:#C06;
width:200px;
height:300px;
float:right;
}
#footer {
background-color:#CCC;
clear:both;
}
</style>
<body>
<h1>Example Page</h1>
<div id="wrap_index">
<div id="col1">
<h4>Column 1</h4>
</div>
<div id="col3">
<h4>Column 3</h4>
</div>
<div id="col2">
<h4>Column 2</h4>
</div>
<div id="footer">
<h4>Footer</h4>
</div>
</div> <--close wrapper -->
</body>
</html>
I'd also do all width statements in the CSS or on the document, but not both. Too easy to confuse oneself... I've done that many a time!