Andy
Andy

Reputation: 443

IE8 Opacity of a div with absolute positioned divs contained inside

Wondering if this is possible: I have a container div, that has opacity set, and inside that div are two(or more) absolute positioned divs. It should make the whole thing transparent,as it does in all browser except IE8 (IE7 even works!)

http://jsfiddle.net/yckQu/6/

Thanks,

Andy

Upvotes: 2

Views: 324

Answers (2)

Igor Archangel
Igor Archangel

Reputation: 1

You could add the following line to the CSS declarations of the inner divs:

filter:inherit;

This should do the job (it worked for me).

Source:

http://www.jacklmoore.com/notes/ie-opacity-inheritance/

Upvotes: 0

McGarnagle
McGarnagle

Reputation: 102783

Almost there. Just update this one line in the CSS:

#opacity, #opacity div {

The issue is that when you write #opacity, it targets that element, but not its child elements. Writing it like above corrects that.

http://jsfiddle.net/yckQu/7/

Upvotes: 1

Related Questions