cssboss

Go 0 to 100 REAL QUICK



Clearing Floated Elements


When a floating element is bigger than the containing element, some pretty weird things can happen.

To avoid layout errors, make sure to put this line of code before the closing tag of the containing element.

<br style="clear:both;" />

for example,

<div>
<img src="myimg.jpg" alt="my  image" style="float:left;" />
<p>just some example text to get my point across.</p>
<br style="clear:both;" />
</div>