Cross Browser PNG Transparency Fix for IE

822 views 1 replies

If you browse to a Web page that contains an image that has a transparent background in Portable Network Graphics (PNG) format, the image background may appear to be gray rather than transparent.

Here is a better use of the AlphaImageLoader fix that would avoid the use of conditional statements for use with cross browser support (as well as cross version for IE 5.5 and up).

<img style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="/images/photo.png" widtth="174px" border="0">


Important : You have to ensure there are no spaces between the span and image tags. The widtth (and height if it is used) declarations must be the same in both the span and image tags. The size adjusting attributes must be present in both tags.


AlphaImageLoader Filter

 

Displays an image within the boundaries of the object and between the object background and content, with options to clip or resize the image. When loading a Portable Network Graphics (PNG) image, tranparency from zero to 100 percent is supported.

Syntax

 

HTML

<ELEMENT STYLE=
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sProperties)"
 ... >

Internet Explorer 5.5 or later

Scripting

object.style.filter =
"progid:DXImageTransform.Microsoft.AlphaImageLoader(sProperties)"

Replies (1)
 
     

 Hi,

Have you worked it out? I wonder how can I accomplish the image resizing process. Do I need another image resizing SDK to help customize the size of images? I am almost a green hand here. Any suggestion will be appreciated. Thanks in advance.      

 

 

 

Best regards,

Arron

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
ARTICLESHIP 20 June 2026
Articleship

RB KESHRI & CO

Mumbai

B.Com

View Details
Company
ARTICLESHIP 30 June 2026
Article Assistant or Paid Assistant

VIKAS VERMA & CO

New Delhi

Others

View Details
Company
29 June 2026
ACCOUNTANT

SANDEEP AASHISH & CO

Araria

B.Com

View Details
Company
ARTICLESHIP 08 June 2026
Internal & Taxation Article

O P Bagla & Co LLP

New Delhi

CA Inter

View Details
Company
12 June 2026
Accounts & Taxation Executive

Winshine Financial Services

Mumbai

CA Inter

View Details
Company
20 June 2026
Chartered Accountant

ANV & Company

New Delhi

CA

View Details
Company
ARTICLESHIP 30 June 2026
Taxation Content Writer Intern

Interactive Media Pvt Ltd.

New Delhi

CA Inter

View Details
Company
Featured 24 June 2026
HEAD - AUDIT AND TAXATION

A R JADHAV AND ASSOCIATES

Mumbai

CA Inter

View Details