Re: Opacity applying to child elements

On Fri, Jan 18, 2013 at 9:03 PM, Philippe Wittenbergh <
ph.wittenbergh@l-c-n.com> wrote:

>
> Le 19 janv. 2013 à 12:41, "Gérard Talbot" <www-style@gtalbot.org> a écrit
> :
>
> > Name:         opacity
> > (...)
> > Inherited:    no
> > (...)
> > If the object is a container element, then the effect is as if the
> > contents of the container element were blended against the current
> > background using a mask where the value of each pixel of the mask is
> > <alphavalue>.
> > "
> > 3.2. Transparency: the 'opacity' property
> > http://www.w3.org/TR/css3-color/#transparency
> >
> > When applying opacity to a container div, then it should not apply and
> > does not apply to its children.
>
> The opacity property applies to the element and all what it contains. The
> whole box and its descendants will be 'faded' or translucent [*]. Of
> course, the descendent elements will no have any opacity applied (unless
> some opacity is specified for them).
>
> As pointed out by Rik Cabanier, what the OP is (possibly) looking for is
> applying some transparency to the background  (and eventually borders) of
> the element — in which case rgba() or hsla() colours should be used.
>

Yes, there is no way to control opacity of the border + background today.
Looking at the drawing order, backgrounds and borders are always drawn in
tandem. [1]

So, it should be possible to create keywords to control the opacity of:
- the border
- the background
- the border and the background

1: http://www.w3.org/TR/CSS2/zindex.html


>
>  [*] the wording in the spec is very confusing for stylesheet authors,
> I've seen that same request often posted to mailing lists (CSS-D and the
> like).
>
> Philippe
> --
> Philippe Wittenbergh
> http://l-c-n.com
>
>
>
>
>
>

Received on Saturday, 19 January 2013 05:16:56 UTC