Results 1 to 7 of 7

Thread: png support problems

  1. #1
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default png support problems

    Hello-
    I'm sure this has come up, but I can't get a png to work in IE 5.5-6. I tried different fixes but it won't work. My image is in the CSS as a background image...and that is the problem...here is my CSS code:

    Here is my CSS:

    #wrapper {
    position: absolute;
    left: 50%;
    width: 774px;
    height: 556px;
    margin-left: -387px; /*set to negative number 1/2 of width*/
    background-image:url(images/shadow_bg.png);
    background-repeat:no-repeat;
    background-position:bottom;
    }

    Can anyone tell me how to make a png used in a style sheet? All I can find is fixes to png's within the actual html...thanks in advance...

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ejewels52 View Post
    I'm sure this has come up, but I can't get a png to work in IE 5.5-6.
    Is this a PNG that uses alpha transparency? That is, one capable of translucency, not just opaque/fully-transparent?

    MSIE doesn't support PNG images properly prior to version 7. There is a scripted hack that uses the AlphaImageLoader filter, but one cannot entirely depend on it.

    As a compromise, if you can engineer a GIF or PNG that only uses single-colour transparency, then that could be served to IE based on the Accept HTTP header sent in the request, provided you have a server-side programming language like PHP available.

    Mike

  3. #3
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response Mike,
    Yes, it is a drop shadow with transparency. Can you tell me how to do this AlhphaImageLoader thing? Its just for my portfolio site, so not too concerned if it isn't completely reliable...I'm fairly new with CSS...thanks, Eric

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ejewels52 View Post
    Yes, it is a drop shadow with transparency. Can you tell me how to do this AlhphaImageLoader thing?
    I'm afraid it won't be suitable for that: the image can't be positioned, unlike a background image.

    If you can't use single-colour transparency, you'd be better off reproducing the image with the background colour already blended into the shadow. That, or hide the shadow from IE6 and earlier, if the document looks good enough without it. Users of IE7, Opera, Firefox, and other decent browsers will still render it properly.

    Mike

  5. #5
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    There is a javascript function that I use for fixing transparent png files problem. It works fine on single color background.
    Just visit;
    http://homepage.ntlworld.com/bobosola/pngtestfixed.htm

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by mwinter
    There is a scripted hack that uses the AlphaImageLoader filter, but one cannot entirely depend on it.
    Scripting is not a solution. Also, that fix is simply a Javascript method to automatically apply said filter, so suffers from the problems Mike described.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by windowpane View Post
    There is a javascript function that I use for fixing transparent png files problem.

    ...

    http://homepage.ntlworld.com/bobosola/pngtestfixed.htm
    Except that's designed for foreground images - img elements.

    Mike

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
  •