針對Chrome的css的hack寫法

來源:互聯網
上載者:User

前端設計師又有活幹了,多了一個找麻煩的兄弟chrome

@media screen and (-webkit-min-device-pixel-ratio:0) {#abc{ margin-left:500px; }}

這個只針對chrome,有人說還有一個寫法,

body:nth-of-type(1) #abc{margin-left:500px;}

但是這個寫法,我測試了一下,在FF裡面也起作用,所以還是第一個。

附:各種常見瀏覽器使用的核心 (Rendering Engine)

Mozilla Firefox ( Gecko )
Internet Explorer ( Trident )
Opera ( Presto )
Konqueror ( KHTML )
Safari ( WebKit )
Chrome ( WebKit )

相關文章

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.