phorcon3 Posted March 13, 2008 Share Posted March 13, 2008 so, what im tryin doing to do is display a diff background-image for both IE and FF so, the code looks something like this: .bg{background-image:(/img/IE.gif);} and i tried: .bg{background-image:(/img/IE.gif);-moz-background-image(/img/FF.gif);} but it wouldnt work. any ideas what i could do? i dont wanna use php or javascript to determine which browser the user is currently using. id like to do it all in CSS, if thats even possible. anyway, id appreciate any help on this, thanks;) Quote Link to comment Share on other sites More sharing options...
haku Posted March 14, 2008 Share Posted March 14, 2008 Its possible. Set the mozilla background in your normal css document: .bg { background-image: url(/img/FF.gif); } Then below the link to that file, add a conditional comment to another css document that is only for Internet explorer: <!--[if IE]> <link rel="stylesheet" type="text/css" href="ieonly.css"> <![endif]--> And finally, set the IE background in there: .bg { background-image: url(/img/IE.gif); } The key is that the link to ieonly.css HAS to be below the link to your normal CSS document, or it wont work. Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted April 4, 2008 Author Share Posted April 4, 2008 yah, thats actually what i used instead too <!--[if gte IE 7]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(/css/ie7.css); /* ]]> */</style><![endif]--> thanks a bunch, haku;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.