W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: Opacity applying to child elements

From: Rik Cabanier <cabanier@gmail.com>
Date: Fri, 18 Jan 2013 21:16:29 -0800
Message-ID: <CAGN7qDAW5By9NLrsuX3gGBf6ZbbP6r9pi=cOvKCsDxATMTbzEg@mail.gmail.com>
To: Philippe Wittenbergh <ph.wittenbergh@l-c-n.com>
Cc: W3C www-style mailing list <www-style@w3.org>, www-style@gtalbot.org, Mohammed Kashim <me@mgakashim.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT