Core tips: CSS tips: About CSS hack and float closure
First, CSS HACK
The following two methods can solve almost all hack today.
1,!important
With the support of IE7 to!important, the!important method is now targeted only at IE6 hack. (Note the wording. Remember that the claim position needs to be advanced.)
<style> #wrapper {width:100px!important; width:80px} </style></P> <P>
2, Ie6/ie77 to Firefox
*+html and *html is the unique label of IE, Firefox is not supported. And *+html is IE7 unique label.
<style><br/> #wrapper <br/>{<br/> #wrapper {width:120px;} <br/>*html #wrapper {width:80px;} <br/>*+html #wrapper {width:60px;} <br/>}<br/></style><br/>
Attention:
*+html to IE7 hack must ensure that the top of the HTML has the following declaration:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" ">
Two, float closes (clear float)
Add the following code to the global CSS, to the need to close the div plus class= "clearfix" can be, once and for all.
<style><br/>.clearfix:after<br/>{<br/>content: "."; <br/>display:block;<br/>height:0;<br/>clear:both;<br/>visibility:hidden;<br/>} <br/>.clearfix<br/>{<br/>display:inline-block;<br/>}<br/>.clearfix {Display:block ;} <br/></style><br/>