Floating any element does a couple things:
1) It removes it from the block-level element flow, meaning it doesn't take up space in what ever block-level element contains it. That DIV has a zero pixel height because both images are floated. But line elements, like text, <span>, <b>, <em>, etc. - and any other tag with display: inline; as one of its style rules, will flow around the edges of floated elements.
2) All floated elements become block-level by default, even floating a <span> tag makes it a block element.
3) Floated elements exist side-by-side unless there isn't enough room or the clear property is applied.
What you really want to do is not float the images, just align the text in that DIV to the right. The <img> tag is inline by default and reacts to the text-align: property.
Do you want text to flow around the images?
In that case:
Code:
<div>
<img ... style="clear: right; float: right;" />
<img ... style="clear: right; float: right;" />
<p>Some text goes here, yada yada yada.</p>
</div>
Bookmarks