Clearfix
I want to share with you great css feature called clearfix. So use it instead of clear:both, and you will be happy. Many times this feature help me in my projects
Using is pretty simple
1 |
<div class="clearfix">
<div style="float:left;"></div>
<div style="float:right;"></div>
</div>
Clearfix class is:
1 | <br /><span style="font-family: Courier New;">.clearfix:after {<br /> content: ".";<br /> display: block;<br /> clear: both;<br /> visibility: hidden;<br /> line-height: 0;<br /> height: 0;<br />}<br /><br />.clearfix {<br /> display: inline-block;<br />}<br /><br />html[xmlns] .clearfix {<br /> display: block;<br />}<br /><br />* html .clearfix {<br /> height: 1%;<br />}</span><br /> |
