On Wednesday 2011-10-19 08:36 -0700, Elli Vizcaino wrote:
> If I recall correctly, child elements inherit the opacity property
> of parent elements. Meaning, any text within a div with an opacity
> declaration would then also take on the same values. Has this
> changed with CSS3?

What happens with opacity isn't inheritance, but it does affect all
the descendants of an element.  When an element has opacity less
than 1, the element and all of its descendants get drawn into a
buffer, and then, in a single step, that buffer is drawn with
opacity onto what's underneath the element.  This means that things
within the element can fully hide each other, even though, when
everything is drawn, the end result is partially transparent.

I wrote some visual examples of this at:
http://dbaron.org/talks/2009-03-15-css3-sxsw/slide-4.xhtml
(and compared with rgba() colors, which affect just a single drawing
operation rather than an entire subtree).

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to