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
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
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.