Forum Moderators: not2easy
When the Main Content area is short enough, the bottom sidebar div (and sometimes the one above it as well) fly over to the left under the Main Content.
<div id="container">
<div id="sidebar"> <!-- float: right; width: yourwidth -->
<div class="sidebar-div">
blah
</div>
<div class="sidebar-div">
blah
</div>
<div class="sidebar-div">
blah
</div>
<div class="sidebar-div">
blah
</div>
</div> <!-- sidebar -->
</div> <!-- container -->
I thought floats had to be cleared.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
<style type="text/css">
body * { border: 1px solid #000; } /* so you can see what's up */
#container { width: 608px; } /* had to stretch for the borders */
#content-left,.inner-row { float: left; width:400px; }
#content-left * { float: left; } /* all children */
.left-image{ width: 100px; height: 100px; }
#sidebar { width: 200px; float:right; }
.sidebar-div { width: 200px; } /* note no float */
</style>
</head>
<body>
<div id="container">
<div id="content-left">
<div class="inner-row">
<div class="left-image"><img src="someimage.gif" alt="test"></div>
<p> Some content here</p>
</div> <!-- inner-row -->
<div class="inner-row">
<div class="left-image"><img src="someimage.gif" alt="test"></div>
<p> Some content here</p>
</div> <!-- inner-row -->
<div class="inner-row">
<div class="left-image"><img src="someimage.gif" alt="test"></div>
<p> Some content here</p>
</div> <!-- inner-row -->
<p> Check it out, I'm not floated but I'm still going to fall below
the floated divs.</p>
</div> <!-- content-left -->
<div id="sidebar">
<div class="sidebar-div">
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
</div>
<div class="sidebar-div">
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
</div>
<div class="sidebar-div">
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
</div>
<div class="sidebar-div">
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
</div>
</div> <!-- sidebar -->
</div> <!-- container -->
</body>
</html>
When you say, "... watch out for the use of any clearing elements, these can cause floated items to pop below content unexpectedly" do you mean _don't_ use any clearing elements?