I just figured it out, and I'll post the solution in case anyone else has the same problem. The issue is that if you put a float inside a div, the div will ignore the floated element when resizing to accomodate its content. This site explains it all:
http://www.ejeliot.com/blog/59
I couldn't use the clear: both solution, because then the div tries to clear the floated sidebar outside the content area, resulting in a large blank space. I found that the overflow: hidden solution seemed to work fine, though I have yet to understand
why it works. The site recommends width: 100% as a way to force hasLayout in IE, but I found that for some reason this shoved the content down to the bottom of the sidebar like clear: both had done, so I used height instead and it looks okay (how does it work when you specify height as a percentage, anyway?).
The final code:
Code: Select all
<div style="overflow: hidden; height: 100%;">
<img style="width: 256px; height: 192px; float: left; margin-right: 1em; margin-bottom: 0.5em;" src="images/photo.jpg"/>
<h3>Joe Schmoe</h3>
<p>A paragraph of descriptive text goes here.</p>
</div>