Css Hack ie6,7,8的hack分別是什麼

來源:互聯網
上載者:User
針對不同的瀏覽器寫不同的CSS code的過程,就是CSS hack。

樣本如下:

#test       {          width:300px;          height:300px;          background-color:blue;      /*firefox*/        background-color:red\9;      /*all ie*/        background-color:yellow;    /*ie8*/        +background-color:pink;        /*ie7*/        _background-color:orange;       /*ie6*/    }         :root #test { background-color:purple\9; }  /*ie9*/    @media all and (min-width:0px){ #test {background-color:black;} }  /*opera*/    @media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} }       /*chrome and safari*/
  • 相關文章

    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.