Is there a way to set any style for a specific browser in CSS?

后端 未结 3 1215
孤独总比滥情好
孤独总比滥情好 2020-12-29 10:35

For example, if I want to set the corner radius in Webkit, Firefox and other than I can use the following CSS:

-webkit-border-radius: 8px;
-moz-border-radi         


        
3条回答
  •  不知归路
    2020-12-29 11:23

    It's very bad habit to apply css for specific browser. But there are solutions also:

    Only Moz:

    @-moz-document url-prefix(){
        body {
            color: #000;
        }
        div{
           margin:-4px;
        }
    }
    

    chome and safari:

    @media screen and (-webkit-min-device-pixel-ratio:0) {
        body {
            color: #90f;
        }
    }
    

    Below IE9:

    
    

    I recommend don't use this moz, and safari prefix untill and unless necessary.

提交回复
热议问题