css hack 大全,csshack

來源:互聯網
上載者:User

css hack 大全,csshack

各個瀏覽器的css hack區別屬性:

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

各個瀏覽器的css hack區別規則

IE6:   *html{}IE7:   +.class{}非IE6: html>body {}僅Firefox:@-moz-document url-prefix(){}saf3+和Google:@media all and (-webkit-min-device-pixel-ratio:0){}僅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){}

但是,我們應該盡量避免使用CSS Hack。

  1. property:value; /* 所有瀏覽器 */
  2. +property:value; /* IE7 */
  3. _property:value; /* IE6 */
  4. *property:value; /* IE6/7 */
  5. property:value\9; /* IE6/7/8/9,即所有IE瀏覽器 */
  1. * html selector { … }; /* IE6 */
  2. *:first-child+html selector { … }; /* IE7 */
  3. html>body selector { … }; /* 非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 */

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.