Internet Explorer hacks for CSS

Nowadays we have many web browsers, such as Internet Explorer, Firefox, Opera, Safari, Chrome etc. But the biggest pain in the ass for web developers is Internet Explorer. How to display website the same in all IE versions – 6, 7, 8, 9 and 10?

I will give you a small tip how to influence Internet Explorer versions.

Conditional comments

  • <!--[if IE 8]> = IE8
  • <!--[if lt IE 9]> = IE8 or below
  •  <!--[if gte IE 8]> =  greater than or equal to IE8

<!--[if IE 8]> <style type="text/css"> /* css for IE 8 */ </style> <![endif]--> <!--[if lt IE 8]> <link href="ie7.css" rel="stylesheet" type="text/css" /> <![endif]-->

IE 9, 10

#name { color: green\0/IE8+9; } /* IE8 + 9 + IE10pp4  */ :root #name { color:#99cc33 \0/IE9; }  /* IE9 + IE10pp4 */

IE 8

.color {color: #f00/;} /* Only for IE 8 */ #name{float:left\9;} /* IE 8 or below */

IE 7

*+html .name {background:#fff;} /* Only IE 7 */ *:first-child+html .box {background:#fff;} /* Only Ie 7 */ *:first-child+html {} * html {} /* IE 7 and below */ .name { *background: #f00;  } /* IE 7 and below */

IE 6

.name { _background/**/:/**/ #f00; } .name { _background:#FFF; }

Comments are closed.
* required

This is a unique website which will require a more modern browser to work! Please upgrade today!