Search code examples
cssmultiple-browsers

have other browsers implemented conditional comments?


IE allows you to do detect which version of IE is running based on their browsers comment conditions (I actually don't know if that is what they are called, someone can correct me if it is not).

<! --[if lt IE 7]> css code here.. <! [endif] -->

Does anyone know if other browsers have followed their example to determine what version of thier browser is being used?

<! --[if FF]> css code here.. <! [endif] -->
<! --[if O]> css code here.. <! [endif] -->

Solution

  • In general, you shouldn't need to do this with modern browsers (FF3.6, Chrome, IE9, Safari). Also, if you target a hack at a browser that is still changing, you run the risk of the hack still working but the problem it solved being fixed, and then your fix breaks.

    Hacks or conditional comments should only be aimed at old browsers (IE6 and IE7 are the main targets).