473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PNG loses transparency when opacity filter is applied in IE7

Unicron
8 New Member
Hi everyone. The title says it all.

I have a collection of PNGs with drop shadows. They work great in IE7 and FF.
If I add filters in my stylesheets, such as

icon {
filter: alpha(opacity=1 0);
-moz-opacity: .10;
opacity: .10;
}

then the PNG shadows all turn into solid black pixels (even If I say opacity 100).
Has anyone ever dealt with this issue? This is for an internal application for use by only a few dozen people, so I am not against hacks.
Feb 18 '08 #1
4 3156
drhowarddrfine
7,435 Recognized Expert Expert
IE6 has never worked with alpha transparency on png although ALL other browsers have for years. IE7 does though. Here is one hack to fix IE.

btw, modern browsers understand 'opacity' so it's not necessary to use '-moz-opacity'
Feb 18 '08 #2
Unicron
8 New Member
Thanks for the reply. I will drop the -moz line.

I had actually already looked at that hack from a google search, but I didn't think that applied as it was meant for IE6, which we don't use.

IE7 displays transparent PNGs just fine unless the filter is applied, regardless of whether its from a stylesheet or a javascript event handler.

For example, I have a button that toggles the icon to 10% opacity. It loads fine with a shadow, then you hit the button and the shadow of the icon suddenly turns solid. If I toggle it back to 100%, the image is still solid.

If I can't get it working, there's always Flash.
Feb 18 '08 #3
drhowarddrfine
7,435 Recognized Expert Expert
I don't know how I got IE6 out of that.

I don't know anything about 'filters' either as I would never use them.
Feb 18 '08 #4
hsriat
1,654 Recognized Expert Top Contributor
I think there's a problem with IE7 displaying PNGs.

Make a PNG image (w/o alpha) and then save it as GIF or JPG.
Embed them together in an HTML file and open it in IE7.
There would be a difference in the colors of PNG from GIF (or JPG) while in Firefox, they'll look same.



But talking about filters, the DOM for images' filters are different in IE from others..

IE - imageObject.sty le.filter.opaci ty = 0 to 100
Others - imageObject.sty le.opacity = 0.00 to 1.00
Feb 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1583
by: Simon | last post by:
In IE I have a routine that dynamically assigns objects' opacity. This works fine for some elements but not for others. It works for buttons and inputs but not for img, span and select. This is the line that sets opacity from a loop through all elements: document.forms.elements.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + FadeOpacity + ")"; Any ideas?
3
10232
by: Marek Mänd | last post by:
This posting will express my concern about the future of css3 forthcoming recommendation. I think for long time now, that the current implementation of CSS attribute opacity is less than usable in practical real life situations. The soon forthcoming CSS3 recommendation does not serve the public interests in this area not at all. The problem relies in the definition what opacity is, how it is to applied to page elements. In past 5...
2
1672
by: mattaku | last post by:
I have a background image for my form that has an alpha channel (PNG or GIF). I would like my form to become semi-transparent and partially show the desktop. I can figure out how to set the form's transparency key to a color and have that color become totally transparent, but I was hoping that the background image would then be shown semi-transparent. Unfortunately, the alpha portion of the background image only shows the background color...
1
1803
by: chris | last post by:
I've used JavaScript DOM scripting to create a table element and alter its opacity. Bizarrely, the contents of the table appear to vanish when the opacity changes. One important note is that I am using transparent PNGs as background images of elements within the table. The following CSS is used to style two elements within the table: ..arrowLeft { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/core/images/arrow.png',
12
3785
by: Patrick Dugan | last post by:
I know that I can change the opacity of an entire form, but is there a way to control opacity to specific controls or components? For example I want to create a form that is semi-transparent (maybe looks like a sheet of green glass) but has elements or graphics on top that I want to be opaque. Perhaps I want the sheet of glass to have writing or other graphics "painted" on the surface. Is there some way to mix varying transparencies...
1
1775
by: dave | last post by:
I am attempted to make a semi-transparent div in IE/Firefox but IE is only making the first image in the div opaque for example if I have a div like: <div class='trans'><img src="foo.jpg"><img src="bar.jpg"><span>text</span></div> only foo.jpg become opaque. any ideas why? It works as expected in firefox
2
3965
by: ivowel | last post by:
Dear Experts: I am trying to write a css style that makes text invisible; visible-when-selected (so that at least a visible block appears over the selected text---like black foreground over black background with 50% opacity to make it gray and shine through what is behind it). Similarly, I want to be able to shows links as blocks (like red on red with opacity 20%). I am trying firefox 1.5.0.9 and konqueror 3.5.5. I presume the...
15
3731
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an element in Firefox.
8
8501
by: mfaisalwarraich | last post by:
Hello, I am using the following method in CSS to make a PNG image transparency preserved: opacity:0.5; filter:alpha(opacity=50);
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.