Clearing HTML floats for all browsers including IE, Firefox, Safari mac and pc

December 7, 2006

I had the problem of two div floats and having the text below clear them in all browsers. After finding this article: my quick solution was this:


<div style=”float:left;”></div>

<div style=”float:right;”></div>

<br style=”clear:both”/>


The key here is that the float elements are contained in their own DIV and a BR tag is used to clear the floats. Those two tricks allow this to work in all browsers.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: