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>

This is awesome

Subscribe now for FREE to get
the most out of your wordpress website

  • We respect your privacy