Partial css (Hack)

Source: Internet
Author: User

1. Conditional Comment Control

  !    [if! IE] "not" operator

Lt [if Lt IE 6] is less than

LTE [If LTE IE 6] is less than or equal to

GT [If GT IE 6] greater than

GTE [if GTE IE 6] greater than or equal to

() [If (LTE IE 6)] for sub-expressions, with Boolean operators

& [if (LTE IE 9) & (GT IE 6)] and operator

| [If (GT IE6) | (! IE)] or operator

  such as:<!--[if IE 6]> only IE6 can be identified <! [endif]-->

* Can only be recognized by IE browser

IE 7 Not only recognizes * symbols, but also identifies!important

div{

Color:green; Show Green in Firefox

Color:red!important; Red shown in//ie7

*color:blue; //IE6 blue in display    

}

IE can recognize *html and *+html, non-IE browser does not recognize

div{color:red;} Non-IE display red

*html div{Color:green;} IE6 Show Green

      *+html div{Color:blue;} IE7 Show Blue 

More ways to differentiate between browsers

#ie6 {_display:block;} IE6

      #ie7 {*+display:block;} IE7

      #ie8 {display:block\0;} IE8

: Root #ie9 {display:block\0;} IE9 Ten

      

2. Common attribute prefixes

-webkit WebKit Core Browser Chrome Safari, etc.

-moz Firefox

-ms IE

-O Opera

such as: rotation effect

  Div{

margin:30px;
width:200px;
height:100px;
Background-color:yellow;
/* Rotate DIV */
    
-ms-transform:rotate ( -3DEG); /* Internet Explorer */
-moz-transform:rotate ( -3DEG); /* Firefox */
-webkit-transform:rotate ( -3DEG); /* Safari and Chrome */
-o-transform:rotate ( -3DEG); /* Opera */

Transform:rotate ( -3DEG); /* No attribute prefix, put in the end will overwrite the prefix of the preceding attribute of the definition */
}

3.ie6 Medium Float Moving Element double the vegetarian. Margin Issues

  The first element in the IE6 that floats to the edge of the parent element, if there is a margin value in that direction, is doubled.

Workaround: Add attribute display:inline for floating elements;

4.

  

Partial css (Hack)

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.