I am in a situation where I need to load one of two stylesheets based on what browser is accessing the page:
if anything but IE then load the "new" stylesheet
if IE >= 9 then load the "new" stylesheet
if IE < 9 then load the old stylesheet
This is the code used to achieve that:
<!--[if lt IE 9]> <link type="text/css" rel="stylesheet" href="/stylesheets/old.css"> <![endif]--> <!--[if gte IE 9]> <link type="text/css" rel="stylesheet" href="/stylesheets/new.css"> <!--<![endif]--> <!--[if !IE]><!--> <link type="text/css" rel="stylesheet" href="/stylesheets/new.css"> <!--<![endif]--> This works well in all modern browsers, and old versions of IE correctly load the old styles. However in old versions of Firefox (3.6) and potentially others, the new css is not loaded and instead --> is printed to the web page. This is because of the line that states !IE - <!--> has to be added, otherwise IE 11 does not load the stylesheet. If I take that out it works properly in Firefox 3.6.
What is the proper way to set up these conditional comments to ensure it will work properly for the various browsers and versions?
[if....] .. <!--<![endif]-->