针对Chrome和Safari等Webkit核心浏览器的CSS hack代码

针对Chrome和Safari等Webkit核心浏览器的CSS hack代码


@media screen and (-webkit-min-device-pixel-ratio:0) {
    /* Webkit内核兼容CSS */
    }

示例:

@media screen and (-webkit-min-device-pixel-ratio:0) {
    .font1 {color:#f00}
    .border1 {border:1px solid #f00;}
    .bg3 {background:#f00;}
    }

除此之外,还有专门针对某个浏览器的CSS hack方法,如针对Webkit核心浏览器和Opera的写法:

/*Webkit and Opera*/
    @media all and (min-0px){
.font1 {color:red;} 
  }

针对Opera浏览器的写法:

/*Opera*/
    @media all and (-webkit-min-device-pixel-ratio:10000),not and all (-webkit-min-device-pixel-ratio:0) {
  .font1 {color:red;}
  }

针对Firefox浏览器的写法:

/*Firefox*/
    @-moz-document url-prefix() {
    .font1 {color:red} 
  }

摘自:http://hi.baidu.com/odvbo/item/42d7c373d5d9444cee1e53a8

写法:

@media screen and (-webkit-min-device-pixel-ratio:0) {.send_moxin textarea{height:164px;}}

原文地址:https://www.cnblogs.com/2boy/p/3141858.html