Various browsers are compatible with the CSS style Writing of the ing

Source: Internet
Author: User

/* CSS styles supported by Google's browser kernel */
@ Media screen and (-WebKit-Min-device-pixel-ratio: 0 ){

Style

}

/* CSS styles specially recognized for IE6 */
* Html. searchbox
{

Style

}

The CSS method for the Firefox browser:
@-Moz-document URL-prefix (){
. Font1 {color: Red}
}

IE8 is debugging on its own. When debugging a browser, you can re-write the corresponding method in the CSS of the kernel. You only need to rewrite the inappropriate style. * Exceptions in HTML are added. * HTML must be added for each rewrite.
For style name

If you only want IE6 to see it, use * html. head {color: #000 ;}
If only IE7 is visible, use * + html. head {color: #000 ;}
If only FF is visible, use: Root body. head {color: #000 ;}
If only FF and IE8 are visible, use HTML>/**/body. head {color: #000 ;}
If you only want IE6 to be invisible, use HTML> body. head {color: #000;} to invalidate IE 6.
* Body. head {color: #000;} is invalid for FF and IE8.

Specific attributes

If you only want IE6 to see _. head {_ color: #000 ;}
If you only want IE7 to see how to use + and _:. head {+ color: # f00 ;!; _ Color: #000 ;}

IE8 official hack

\ 9 "Example:" margin: 0px auto \ 9; ". Here" \ 9 "can distinguish all IE8 and Firefox.
"*" IE6 and IE7 can be identified. IE8 and Firefox cannot.
"_" IE6 can recognize "_". IE7, IE8, and Firefox cannot.
For example:
. A {color: # f00; color: # f60 \ 9; + color: #00ff00; _ color: # 0000ff ;}
Corresponds to FF and IE8 IE7 IE6 from left to right
You must remember the sequence when writing CSS styles:

Reference content is as follows:
#1 {color: #333;}/* Moz */
* Html #1 {color: #666;}/* IE6 */
* + Html #1 {color: #999;}/* IE7 */

Order is important

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.