Forum Moderators: not2easy
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
div.footer {
width:750px;
clear:both;
padding: 0 0 10px 0;
margin:0px auto 0px auto;
background:url(footer_bg.jpg) center 79px repeat-y #00CCFF;
}
div.footer-header {
width:750px;
height:80px;
background:url(footer_header.jpg) center no-repeat;
padding:0px;
margin:0px;
}
div.recently {
width:250px;
float:left;
height:350px;
text-align:left;
}
div.recommended {
width:270px;
float:left;
height:350px;
}
div.third-c{
width:230px;
float:left;
height:350px;
padding:0;
margin:0;
text-align:left;
background:#00FF00;
}
</style>
</head>
<div class="footer">
<div class="footer-header"></div>
<div class="recently"></div>
<div class="recommended">
<p><img src="back_to_basics.gif" /></p>
<p><img src="stacie.gif" width="100" height="100" /></p>
<p><img src="css.gif" width="100" height="129" /></p>
</div>
<div class="third-c"></div>
</div>
</body>
</html>
If, perchance, floating the parent container breaks your layout, you could use a clearing div instead:
<div style="clear:both;height:1px;overflow:hidden;font-size:0.1em;"> </div> (inline styles for examplified usage)
This forces the parent container to push past the floated children to accommodate for the clearing div (keep in mind, this will take up 1px of space.)
If the 1px of blank space is unwanted for design issues, you could try keeping one of the floated children (the tallest, typically) as in the normal document flow: this way, the parent acknowledges it, and pushes past it automatically.
Just some suggestions :)
P.S.: Yep, you recall correctly, that's exactly how they're meant to render.
[edited by: Setek at 10:08 am (utc) on Sep. 6, 2006]
regards...