CSS HACK
The following two approaches solve almost all hack today.
1,!important
With the support of IE7 to!important, the!important method now only targets 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>
#wrapper
{
#wrapper {width:120px;}
*html #wrapper {width:80px}
*+html #wrapper {width:60px}
}
</style>
Note:
*+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" ">
Float closure (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>