Home > Web Front-end > HTML Tutorial > div CSS browser compatibility issues (IE6.0, IE7.0, ie8, FireFox...) 4_html/css_WEB-ITnose

div CSS browser compatibility issues (IE6.0, IE7.0, ie8, FireFox...) 4_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:29:42
Original
1091 people have browsed it

Features related to compatibility of IE6, IE7, FF

CSS HACK
Code:
Common to all browsers
height: 100px;

For IE6
_height: 100px; powered by 25175.net

For IE6
*height: 100px;

For IE7
* height: 100px;

Shared by IE7 and FF
height: 100px !important (priority);
1. CSS HACK
The following two methods can solve almost all HACKs today.

1 , !important (not very recommended, it feels safest to use one of the following)

With IE7’s support for !important, the !important method is now only for IE6’s HACK. (Pay attention to the writing. Remember the declaration position Need to advance.)

Code:


2, IE6/IE77 for FireFox

* html and *html It is a tag unique to IE and is not supported by Firefox. And *html is a tag unique to IE7.

Code:


Note:
* html HACK for IE7 must ensure the following statement at the top of the HTML:

Code:


2. Universal float closure (very important!) You can use this to solve multiple problems The spacing when aligning divs is wrong.

For the principle of clear float, please refer to [How To Clear Floats Without Structural Markup]
Add the following code to Global CSS and add class=" clearfix", it works repeatedly.

Code: