• I am trying to do something that would seem rather simple but I am running into big solutions.

    I have a single graphic/image that is on a page, it is a png making use of the trasparency. I would like the image to switch to a gif whenever IE loads the page. So far I keep finding big scripts and fairly intensive solutions. Any body have something simple and light.

Viewing 2 replies - 1 through 2 (of 2 total)
  • yeah, in the stylesheet use the png as the default backgroung image for wherever you want it.

    Then, make use of the IE6 hack, and tell it to make the defauly image as the gif.

    i.e.

    #header{
       background:url(images/image.png) 0 0 no-repeat;
       }
    
    *html #header{
       background:url(images/image.gif) 0 0 no-repeat;
       }

    Now, in any browser except for IE6, the background will be the png, and in IE6 the background will be the gif.

    good luck?

    Thread Starter Aaron

    (@ergate)

    Fantastic, thanks. I will add these to my reference material.

    I did find another solution that allows me to use the png. It was very easy to use, add one line to the css and add the script to the site. (fixes the alpha chanel with transparent gif)

    Well, now you can add decent PNG support to IE5.5+ on Windows with no changes to your website HTML source code. This script will add near-native PNG support with full alpha opacity, with only one line in your CSS file, that applies to all <img> tags and also background images!

    found here http://www.twinhelix.com/css/iepngfix/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘help with image switch by browser’ is closed to new replies.