Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    change body background if IE

    Hi,

    is it possible to have a different background image on IE to firefox, I am doing my background image as shown below:

    Code:
    <body style="background-image: url(unbranded_bg.png);">
    however I want script that says if IE, show unbranded_bg2.png and if firefox show unbranded_bg.png.

    Many Thanks,
    Simon

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    is there a way I can do it for all internet explorer versions? and also where abouts would I put that? im still learning javascript as I go along.

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by simonstaton View Post
    is there a way I can do it for all internet explorer versions? and also where abouts would I put that? im still learning javascript as I go along.
    It is not about javascript but CSS. Give your element a class, and create separate external CSS files, one for IE, one for the others. Use the conditional comments. The CSS file for IE should be loaded after the other one.
    Code:
    <head>
    ...
    ...
    <link href="css/standard.css" rel="stylesheet" type="text/css">
    <!--[if IE]>
    <link href="css/ie.css" rel="stylesheet" type="text/css">
    <![endif]-->
    </head>
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks worked


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •