Jump to content

IE&FF (background-image)


phorcon3

Recommended Posts

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;)

Link to comment
https://forums.phpfreaks.com/topic/96035-ieff-background-image/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/96035-ieff-background-image/#findComment-491903
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.