Explore the CSS hack writing for Googlechrome

Source: Internet
Author: User
Tags valid

This section and you learn about googlechrome Google Browser for the use of CSS hack, CSS hack is because the existing browser to the standard resolution is different, in order to compatible with the browser, the use of a remedy; some people say that CSS hack is a kind of cheating method, For compatibility purposes in a deceptive browser, browser compatibility issues are resolved using browser compatibility differences.

Introduction to CSS Hack

CSS hack because existing browsers are different from standard parsing, a remedy for compatibility with browsers.

CSS hack is a kind of cheating-like means to deceive the browser to achieve compatibility purposes, is to use browser compatibility differences to resolve browser compatibility issues. Therefore, at the beginning of the design, write CSS hack need to follow the following three principles.

CSS hack for googlechrome Google browsers

Google on September 3 launched a browser googlechrome, writing front-end effect of the comrades have a hard work, Ie/ff/opera/safari/googlechrome was not a peaceful world more chaotic.

Fortunately Googlechrome is using the same WebKit engine as safari, we can use a similar way to make CSS hack, written as:

Examplesourcecode

 
  
 
  1. @mediascreenand (-webkit-min-device-pixel-ratio:0) {
  2. /* for Googlechrome, Safari3.0, Opera9 CSS style * *
  3. }

Another kind of CSS hack with the added # is not valid for Chrome, which may be different from the WebKit version. This CSS hack is not valid

Examplesourcecode

 
  
 
  1. P.callout{color: #FF0000; font-weight:normal;}
  2. P.callout{color: #000000; font-weight:bold;#}

Attached: The kernel used by various common browsers (Renderingengine)

Examplesourcecode

 
  
 
  1. Mozillafirefox (Gecko)
  2. InternetExplorer (Trident)
  3. Opera (Presto)
  4. Konqueror (khtml)
  5. Safari (WebKit)
  6. Googlechrome (WebKit)

"Edit Recommendation"



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.