Screen shot 2012-06-26 at 12.27.44 AM

Clearing Floated Elements

June 26, 2012

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,

<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;" />

In his last 10 years as a freelance Web Designer / Developer, Andrew Kaser has achieved further than just a “higher understanding of creating symantec code while keeping resources low.” Kaser looks to help promote better web standards in order to build a flourished industry that exceeds current development practices.

Leave A Comment