The IE conditional comment

IEWhen working with CSS, cross browser compatibility is also an issue. Mostly on Internet Explorer web browsers. A way many web designers/developers get around this problem is by targeting certain IE with it's own CSS stylesheet to fix styling issues since each version renders CSS differently. This method is by using an IE conditional comments placed in the HTML tag.

I always keep a list as a reference when working with IE. Here is a list of conditional statement to target certain CSS styles to be applied to each or all Internet Explorer.


internet explorer will execute this code


internet explorer 6 will execute this code


internet explorer 7 will execute this code

This will work with any specific version of IE from 5 onwards (5.5 and other decimals also allowed)

lt = less than operator

internet explorer lower than version 7 will execute this code

gt = greater than operator

internet explorer 6 or higher will execute this code-->

There are also the gte (greater than or equal to) and the lte (less than or equal to) operators available.

The other very interesting operator to me is the NOT operator: !

internet explorer will ignore this code

Related Posts

Add new comment