Css hack, csshack

Source: Internet
Author: User

Css hack, csshack

Different css hack attributes of each Browser:

IE6:       _zoom:1;IE6/7:     *zoom:1;IE6/7/8/9 :\9

Css hack rules for different browsers

IE6: * html {} IE7: +. class {} non-IE6: html> body {} Only Firefox: @-moz-document url-prefix () {} saf3 + and Google: @ media all and (-webkit-min-device-pixel-ratio: 0) {} Only opera: @ media all and (-webkit-min-device-pixel-ratio: 10000), not all and (-webkit-min-device-pixel-ratio: 0) {} iphone/mobile/webkit: @ media screen and (max-device-width: 480px ){}

However, we should try to avoid usingCSS Hack.

  1. Property: value;/* all browsers */
  2. + Property: value;/* IE7 */
  3. _ Property: value;/* IE6 */
  4. * Property: value;/* IE6/7 */
  5. Property: value \ 9;/* IE6/7/8/9, that is, all IE browsers */
  1. * Html selector {... };/* IE6 */
  2. *: First-child + html selector {... };/* IE7 */
  3. Html> body selector {... };/* Non-IE6 */
  4. @-Moz-document url-prefix (){... };/* Firefox */
  5. @ Media all and (-webkit-min-device-pixel-ratio: 0 ){... };/* Saf3 +/chrome1 + */
  6. @ Media all and (-webkit-min-device-pixel-ratio: 10000), not all and (-webkit-min-device-pixel-ratio: 0 ){... };/* Opera */
  7. @ Media screen and (max-device-width: 480px ){... };/* IPhone/mobile webkit */

Related Article

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.