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 declaration position needs to be advanced.) )
<style> #wrapper { Width:100px!important; width:80px; } </style> |
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> #wrapper { #wrapper {width:120px;} *html #wrapper {width:80px;} *+html #wrapper {width:60px;} } </style> |
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> . clearfix:after { Content: "."; Display:block; height:0; Clear:both; Visibility:hidden; } . clearfix { Display:inline-block; } . clearfix {Display:block} </style> |