/ Published in: CSS
works in IE6, IE7 and Firefox
Expand |
Embed | Plain Text
.autoclear:after {content: "."; display: block; height: 0; clear: both; visibility: hidden; } .autoclear {display:inline-block;} .autoclear {display:block;} * html .autoclear {height: 1%;}
Comments
Subscribe to comments
You need to login to post a comment.

is it possible, please- to see a snippet of code as to how these css classes would be used in html, after the floated elements?
Given this example:
CONTENT LEFT CONTENT RIGHT
You can turn it into this, with no extra markup to clear floated elements:
CONTENT LEFT CONTENT RIGHT
Sorry:
<div id="container" class="autoclear"> <div style="float:left;">CONTENT LEFT</div> <div style="float:right;">CONTENT RIGHT</div> </div>