+ Reply to Thread
Results 1 to 3 of 3

Thread: Transparent PNG IE6

  1. #1
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Transparent PNG IE6

    I have some transparent PNGs that I use in a site.

    In order for them to work in IE6 and below I have used the following code:-
    Code:
    #img_logo
    {
          filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='images/logo_sm_png.png');
    }
    
    I have several PNG images I want to use this on, so was wondering if there's anyway of doing this dynamically instead of adding a class for each image? ie can the src= section have the path and image name passed to it using CSS?

    I'm not brilliant on CSS so unsure if this is possible or not.

    Hope that makes sense.

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    I don't know of anyway to do this using CSS. I'm not so sure you would really want to, anyway. From what I've read, this can slow down the page load and cause the browser to appear to freeze. Read here: Image Optimization, Part 5: AlphaImageLoader
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    I've just gone for a PNG with a colour palette and 100% dithering which seems to work, although the image isn't as crisp as with a true colour PNG.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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

SEO by vBSEO