Search code examples
javascriptcssconditional-comments

Including style sheets for different browsers without JavaScript


I have a utility that scans through my css file and embeds images as base64 to reduce the amount of requests made to the server. Unfortunatly, IE does not support this.

I know how to include IE specific style sheets using conditional comments, but what about FF, Opera and Webkit? I don't want to give IE style sheets that it doesn't use.

Thanks


Solution

  • If I understand your question correctly, (and if I don't), you can exclude CSS files from IE using conditional comments:

    <![if IE 9]>
    IE will ignore this; other browsers won't.
    <![endif]>