cssHack

CSS Hack

在线查询 hack

属性/值 Hack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* IE 6 */
.selector { _color: blue; }
.selector { -color: blue; }
/* IE 6/7 - acts as an !important */
.selector { color: blue !ie; }
/* string after ! can be anything */
/* IE 6/7 - any combination of these characters:
! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > | */
.selector { !color: blue; }
.selector { $color: blue; }
.selector { &color: blue; }
.selector { *color: blue; }
/* ... */
/* IE 8/9 */
.selector { color: blue\0/; }
/* must go at the END of all rules */
/* IE 9/10 */
.selector:nth-of-type(1n) { color: blue\9; }
/* IE 6/7/8/9/10 */
.selector { color: blue\9; }
.selector { color/*\**/: blue\9; }
/* Everything but IE 6 */
.selector { color/**/: blue; }

IE Media Query Hack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* IE 6/7 */
@media screen\9 {}
/* IE 8 */
@media \0screen {}
/* IE 9/10, Firefox 3.5+, Opera */
@media screen and (min-resolution: +72dpi) {}
/* IE 10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {}
/* IE 6/7/8 */
@media \0screen\,screen\9 {}
/* IE 8/9/10 & Opera */
@media screen\0 {}
/* IE 9/10 */
@media screen and (min-width:0\0) {}
/* Everything but IE 6/7/8 */
@media screen and (min-width: 400px) {}