Results 1 to 3 of 3

Thread: MSIE not loading PNG bug.

  1. #1
    Join Date
    Mar 2006
    Location
    UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default MSIE not loading PNG bug.

    I'm using the AlphaImageLoader filter to load a transparent png as a transparent background from a CSS file. I use some IE hacks to load this PNG in properly in Standards browsers and it works fine.

    I ussually put my styles sheets in a /styles directory for easier management. However MSIE will only load the png as a background if the css is in the same directory as the HTML file, not if it is in the /styles sub directory.

    Does anyone know why this is and/or how to fix it?

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

    Default

    Quote Originally Posted by Citizen
    I'm using the AlphaImageLoader filter [...]

    I ussually put my styles sheets in a /styles directory for easier management. However MSIE will only load the png as a background if the css is in the same directory as the HTML file, not if it is in the /styles sub directory.

    Does anyone know why this is and/or how to fix it?
    When the url() functional notation is used in CSS (for background images, and the like), a relative URL is resolved against the location of the CSS file. However, for some reason, IE bucks this trend with filters and resolves relative URLs against the location of the document that references that CSS file.

    Therefore, with a document and CSS file with the following URLs,

      http://www.example.com/html/corporate/about-us.html
      http://www.example.com/css/common.css

    the value,

      url(../images/logo.png)

    would resolve to:

      http://www.example.com/images/logo.png

    but the filter,

      progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/logo.png')

    would resolve to:

      http://www.example.com/html/logo.png

    Hope that helps,
    Mike

  3. #3
    Join Date
    Mar 2006
    Location
    UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's great thanks!

    I hadn't even thought of trying that ...

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
  •