Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE CSS "filters" break alpha transparency

I'm trying to figure out whether there's a weird solution to this weird problem.

Basically, IE >= 7 supports PNG transparency perfectly, and it has also supported a lot of the new cool stuff in CSS3 for years, through weird settings in the "filter" property.

However, when you apply a filter to an element that has a PNG background, the alpha-transparency of that background basically breaks (very similarly to how IE6 did).

If possible, I'd like to use the CSS3 properties that other browsers give me, and also get them in IE, instead of implementing them in JS (transitions) or not at all (rotations), but I can't unless I find a fix for the semi-transparency problem.

Has any of you found this problem and a fix for it?


EDIT: Added some code, although I'm not sure it exemplifies much:

#.faded {
    filter:progid:DXImageTransform.Microsoft.Fade(duration=2)
}

When I add this, PNG opacity breaks in IE for those element. It actually happens with all filters, or at least all I've tried.


Thank you!
Daniel

like image 926
Daniel Magliola Avatar asked Aug 10 '11 14:08

Daniel Magliola


People also ask

How do I turn off transparency in CSS?

If you want to remove the opacity or transparency from the sticky navigation bar, just navigate to Theme Options -> General -> Additional CSS and copy/paste this code and save changes. You could also manipulate the opacity by altering the value “1” at the end of the CSS statement.

Is opacity the same as Alpha?

The alpha (opacity) value is a number from 0 to 1, e.g. 0.1 is almost fully transparent and 0.9 is almost fully opaque.

How do I change the transparency of something in CSS?

To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property range from 0 to 1. If you set the property to 0, the styled element will be completely transparent (ie. invisible).

How do you make a Div completely transparent?

Example explained First, we create a <div> element (class="background") with a background image, and a border. Then we create another <div> (class="transbox") inside the first <div>. The <div class="transbox"> have a background color, and a border - the div is transparent.


1 Answers

Have you tried CSS3 PIE or some other third party solution - no need to reinvent the wheel if an existing solution already works.

like image 90
Alok Avatar answered Oct 13 '22 11:10

Alok