I. Basic Concepts
CSS hack:Write different CSS codes for different browsers.
CSS hack principle:Because different browsers have different support for CSS and parse results, they also have a relationship with the priority of CSS. We can write different CSS for different browsers based on this.
Browser priority:FF <IE7 <IE6
The writing order is generally to write the CSS of a highly recognizable browser behind it, and the CSS hack writing order is generally FF IE7 IE6.
The DIV + CSS browser is compatible with IE6, IE7, and FFDifferences:
1. ie can recognize *; standard browsers (such as ff) cannot recognize *;
2. IE6 can recognize *, but cannot recognize it! Important,
3. IE7 can recognize * and can also recognize! Important;
4. Firefox cannot recognize *, but it can recognize it! Important;
1. Differences between IE6 and Firefox:
Background: orange; * Background: blue;
The background color of Firefox is orange, while that of IE is blue.
2. Differences between IE6 and IE7:
Background: Green! Important; Background: blue;
The background color of IE7 is green, and the background color of IE6 is blue.
3. Differences between IE7 and FF:
Background: orange; * Background: green;
The background color of Firefox is orange, while that of IE7 is green.
4. FF, IE7, and IE6:
* Background: Green! Important;
* Background: blue;
The background color of Firefox is orange, that of IE7 is green, and that of IE6 is blue.
(1) Development Platform Selection
Write CSS on Firefox and be compatible with other browsers. it is certainly easier to do this than to make other browsers compatible with IE, because IE still has good support for old standards, but some of the unique features of IE are not supported by others. therefore, we recommend using Firefox with firebug extension as a platform.
(2)). CSS hack Sequence
Use Firefox as the platform, as longCodeThere won't be many places where hack is written, and almost no problem exists in browsers other than IE, so you can ignore it temporarily,
The order is as follows:Firefox> IE6> IE7> others
(3)). Hack Method
there are two methods: Processing in different files, the other is processing in the same file. in fact, the role is the same, but the starting point is different.
1. processing in the same file.
for example, : id = "bgcolor" IE6 blue , IE7 green , Firefox .