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

Browser CSS Hack Collection

巴扎黑
Release: 2017-05-01 14:29:02
Original
1621 people have browsed it

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

 Firefox 浏览器

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

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

*>.selector { property: value; }
Copy after login

 Webkit 内核浏览器

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

 Opera 浏览器

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

 IE 浏览器

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

  IE 9

:root Selector {property: value\9;}
Copy after login

  IE 9-

Selector {property: value\9;}
Copy after login

  IE 8

Selector {property: value/;}

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

  IE 8+

Selector {property: value\0;}
Copy after login

  IE 7

*+html Selector{property:value;}

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

  IE 7-

Selector {*property: value;}
Copy after login

  IE6

Selector {
  _property: value;
}

或者: 
*html Selector {
  property: value;
}
Copy after login

               

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

Related labels:
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