Home >Web Front-end >CSS Tutorial >Browser CSS Hack Collection

Browser CSS Hack Collection

巴扎黑
巴扎黑Original
2017-05-01 14:29:021644browse

  所谓的Hack就是只有特定浏览器才能识别这段hack代码。Hack 不是什么好东西,除非没有办法,我们尽量还是不要用着玩意。 下面是各个浏览器的CSS Hack 列表。

 Firefox 浏览器

@-moz-document url-prefix() {
  .selector {
    property: value;
  }
}

  支持所有Gecko内核的浏览器 (包括Firefox)

*>.selector { property: value; }

 Webkit 内核浏览器

@media screen and (-webkit-min-device-pixel-ratio: 0) {
  Selector {
    property: value;
  }
}

 Opera 浏览器

html:first-child>b\ody Selector {property:value;}

 IE 浏览器

  IE 浏览器针对不同的版本有不同个Hack方式。

  IE 9

:root Selector {property: value\9;}

  IE 9-

Selector {property: value\9;}

  IE 8

Selector {property: value/;}

或:
@media \0screen {
    Selector {property: value;}
}

  IE 8+

Selector {property: value\0;}

  IE 7

*+html Selector{property:value;}

或:
*:first-child+html Selector {property:value;}

  IE 7-

Selector {*property: value;}

  IE6

Selector {
  _property: value;
}

或者: 
*html Selector {
  property: value;
}

               

The above is the detailed content of Browser CSS Hack Collection. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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