Home > Web Front-end > CSS Tutorial > Css Hack What are the hacks for ie6, 7, and 8?

Css Hack What are the hacks for ie6, 7, and 8?

高洛峰
Release: 2016-11-03 17:05:01
Original
2227 people have browsed it

针对不同的浏览器写不同的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*/
Copy after login


Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template