To resolve the compatibility of Web pages in IE7: *
such as:. content{height:30px; / * Normal Display effect * / *height:20px; /*ie7 Display effect * / }
To resolve the compatibility of Web pages in IE8:
Make a judgment on the head of the Web page.
<! DOCTYPE html>
<!--[if IE 8]> <![ Endif]-->
<!--[if! IE 8]>
<!--<! [endif]-->
If it is under IE8 browser, use the class name prefixed with the. IE8 style.
such as:. content{height:30px;} / * Styles displayed in other browsers * /
. IE8 . content{height:20px;} the style shown in/*IE8 * /
To fix the compatibility of Web pages in Firefox:
@-moz-document Url-prefix () {/ * write the necessary style here * /}
Note: This is a way to solve all the incompatibilities of Firefox browsers.
To resolve the compatibility of Web pages in IE9:
\9\0(only used in IE9, other browsers do not recognize)
To resolve the compatibility of Web pages in IE10:
@media screen and (-ms-high-contrast:active), (-ms-high-contrast: none) {
. hacktest { background-color:Green;} /* For ie10+ This notation can be adapted to high contrast and default mode, thus covering all ie10 modes */
}
Selector Prefix method
The selector prefix method is for browsers that are inconsistent with some pages or that require special treatment, hack with prefixes that are only recognized by certain browsers before the CSS selector.
At present, the most common is
*html *Prefix only valid for IE6*+html *+Prefix only valid for IE7@media screen\9{...}only toIE6/7Effect@media \0screen {body {background:red;}}only toIE8Effective@media \0screen\,screen\9{body {background:blue;}}only toIE6/7/8Effective@media screen\0 {body {background:green;}}only toIE8/9/10Effective@media screen and (min-width:0\0) {body {background:gray;}}only toIE9/10Effective@media screen and (-ms-high-contrast:active), (-ms-high-contrast:none) {body {background:orange;}}only toIE10Effective, etc.
css--browser compatibility processing (PC)