Back to Blog

Targeting Different Browsers with CSS & Conditional Comments


Simply put, every web developer must deal with browser inconsistency’s. Fortunately CSS hacks are very much a thing of the past, and there are better solutions to cross browser compatibility. My method of choice is Internet Explorer’s conditional comments. These allow for the separation of Explorer specific code from “valid” code.


CSS (ie.css)

/* General ------------------------------------*/
/* IE6 ----------------------------------------*/
* html body
/* IE7 ----------------------------------------*/
div > p

How it works

Conditional comments only work in Internet Explorer. This allows us to give special instructions for only Explorer. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0.

Related Links


How we work Process

Product Hero Talin Wadsworth