What are the ways of writing css in various browsers?
What this article shares with you is about how css is written in various browsers. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
The code is as follows:
* margin:0px 0px-4px 0px! important; / * for IE7.0***/ * margin:0px-5px-4px 0px; / * for IE6.0***/ margin:0px 0px 0px 0px; / * for FF*/
Distinguish IE6 from FF:
The code is as follows:
Background:orange;*background:blue
Distinguish IE6 from IE7:
Background:green! important;background:blue
Distinguish IE7 from FF:
Background:orange; * background:green
Distinguish between FF,IE7,IE6:
Background:orange;*background:green! important;*background:blue
Note: IE can recognize *; standard browsers (such as FF) can not *
IE6 can recognize *, but not! important
IE7 can recognize *, can also recognize! important
FF does not recognize *, but can recognize! important
IE6 IE7 FF
* √ √ ×
! important × √ √
Add another one, underscore "_"
IE6 supports underlining, while neither IE7 nor firefox supports underlining.
So you can also distinguish IE6,IE7,firefox in this way.
: background:orange;*background:green;_background:blue
Note: no matter what method it is, the writing order is firefox in front, IE7 in the middle, and IE6 at the end.
These are the ways in which css is written in various browsers, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.