CSS hack Summary

Source: Internet
Author: User
Shield ie browsers (that is, they are not displayed under IE)
*: Lang (zh) Select{ Font: 12px! Important;}/* ff, OPNote: Due to the recent upgrade of opera, this sentence is only recognized by FF */
Select: Empty { Font: 12px! Important;}/* safari visible */
Here, select is the selector, which can be changed as needed. The second sentence is unique to the Safari browser on Mac.
Only IE7 and ie5.0 can be recognized
* + Html Select{ ...}
This hack can be used only for IE7 and ie5.0.
Only IE7 can recognize
* + Html Select{ ...! Important;}
This hack can be used only for IE7.
Identification of IE6 and IE6 or lower
* Html Select{ ...}
Note that many blogs have written the hack of IE6. In fact, ie5.x can also identify this hack. Not recognized by other browsers.
Html/**/> body Select{ ...}
This sentence serves the same purpose as the previous one.
Only IE6 is not recognized, and IE6 is blocked
Select{ Display/* Block IE6 */: None;}
Here we mainly use CSS annotations to separate an attribute and a value, and comment it before the colon.
Only IE6 and ie5 are not recognized, blocking IE6 and ie5
Select/**/{ Display/* IE6 and ie5 are not recognized */ : None;}
The difference here is that a CSS comment is added between the separator and curly braces. Ie5.5 is not blocked
Only ie5 is not recognized, and ie5 is blocked
Select/* Ie5 does not recognize */{ ...}
This sentence removes the comment of the attribute area from the previous sentence. Only ie5 is not recognized, and ie5.5 is recognizable.
Box Model Solution
Selct{ Width: ie5.x width;Voice-family: "\"} \ ""; voice-family: Inherit; Width: The correct width;}
The box model clearing method is not passed! Important. This should be clear.
Clear floating
Select: After {content: "."; display: block; Height: 0; clear: Both; visibility: hidden ;}
In Firefox, when the child level is floating, the height of the parent level cannot fully cover the entire child level, in this case, the floating hack can be used to define the parent level.
Ellipsis (...)
Select{-O-text-overflow: ellipsis; white-space: nowrap; overflow: hidden ;}
This is a good technique to cut out more text and end it with a ellipsis. But Firefox does not currently support it.
Only opera Recognition
@ Media all and (min-width: 0px ){ Select {......}}
Set the Opera Browser separately.

The above are some hack in CSS, which are used to solve the local compatibility problem. If you want to separate the compatibility content, try several filters below. Some of these filters are written in CSS to import special styles through filters, and some are written in HTML to link or import the required patch styles through conditions.

Ie5.x filter, only visible to ie5.x
@ Media tty {
I {content: "\";/* "*/} @ import' ie5win.css ';/*";}
}/**/
Ie5/MAC filters are generally not required
/*\*//*/
@ import" ie5mac.css ";
/**/
If condition hack of IE
only ie
all IE identifiable
only Internet Explorer 5.0
only ie5.0 can recognize
only IE 5.0 +
both ie5.0 and ie5.5 can be identified
only IE 6-
only IE6 is recognizable
only IE 6/+
ie5.x under IE6 and IE6 can be recognized
only IE 7/-
only IE7 is recognizable
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.