W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css3-background]

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 27 Feb 2012 23:37:28 -0800
Message-Id: <EAE8C64C-2EDE-4DA2-A18A-7B4A21942B83@gmail.com>
Cc: Lev Solntsev <greli@mail.ru>, www-style <www-style@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
On Feb 27, 2012, at 12:35 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Mon, Feb 27, 2012 at 11:38 AM, Lev Solntsev <greli@mail.ru> wrote:
>> Hello!
>> Now CSS Backgrounds and Borders Module Level 3 working draft says that you
>> can specify color only on final background layer. It could be reasonable
>> because one can see nothing under the solid colored background. But there is
>> one option that left forgotten: semi-transparent colors, which can be
>> defined with hsla or rgba.
>> Imagine, I may want to place a picture on background, then blend it by
>> semitransparent black or white, and place some picture on top. I can't do it
>> now with current background syntax and I believe that the specification must
>> allow this scenario.
>> Of course, I can fake semitransparent color by a special cooked picture but
>> is it what CSS is called to avoid, isn't it?
> As Brian points out, this restriction has been in B&B for years.
> That said, you can achieve the effect you want by with the image()
> function <http://dev.w3.org/csswg/css3-images/#image-notation> by just
> putting the color you want inside of it, as illustrated in example 7
> at the link I gave.

Or you could create an inner (inset) shadow with a really large spread (no blur or offsets needed). Or you could use ::before to create an absolutely positioned box that fills up the width and height of the element. These are hacks, of course, but are more or less usable now (the second one would work in more versions of IE).
Received on Tuesday, 28 February 2012 07:37:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC