public
Last active

IE CSS hacks

  • Download Gist
ie-css-hacks.css
CSS
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 30 31
/*
* Property prefix hacks
*/
 
/* IE6 only - any combination of these characters */
 
_ - £ ¬ ¦
 
/* IE6/7 only - any combination of these characters */
 
! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > |
 
/*
* @media hacks
*/
 
/* IE6/7 only (via Keith Clarke) */
 
@media screen\9 { }
 
/* IE6/7/8 (via Keith Clarke) */
 
@media \0screen\,screen\9 {}
 
/* IE8 (via Keith Clarke) */
 
@media \0screen { }
/* IE8/9 (maybe IE10 final) */
 
@media screen\0 { }

Some more here: http://mathiasbynens.be/demo/css-hacks (view in the browser of your choice)

/* IE8/9 (maybe IE10 final) */

@media screen\0 { }

yes, it's definitely working on IE10.

"@media \0screen\,screen\9 {}" and "@media \0screen { }" don't work in IE8 when I minify my css.

what about hack for different IE screen resolutions?

Anyone have answers for below code:
@media (min-width:1366px) and (max-width:1500px){
.header{height:200px;}
}
@media (min-width:1280px) and (max-width:1365px){
.header{height:150px}
}

Have tried using below code but does not work.

@media screen\9 and (min-width:1366px) {
.header{height:200px}
}
@media screen\9 and (min-width:1280px) {
.header{height:150px}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.