W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: fallback color for background-image (ISSUE-5)

From: Alan Gresley <alan@css-class.com>
Date: Sun, 06 Apr 2008 23:03:30 +1000
Message-ID: <47F8CA22.4060202@css-class.com>
To: Josef <e9427749@student.tuwien.ac.at>
CC: www-style@w3.org

Josef wrote:
> 
> Alan Gresley wrote:
> 
>  > content: "hello" / url(hello.png);
>  > background: blue / url(hello.png), url(goodbye.png), transparent;
>  >
>  > The fall back to the left I think is more intuitive for authors. Also
>  > using commas would mess with multiple background strings. This would
>  > be better.
>  >
> For me it is too ugly.
> And this seems very restricted and not orthogonal in the first place


Please see Issue-5 so you can clearly understand the issue.

http://www.w3.org/Style/CSS/Tracker/issues/5


> Anyway, here a idea with i think is better:
> background: url(hello.png),..., transparent,fallback(blue);


Please see multiple background in the specs.

http://dev.w3.org/cvsweb/csswg/css3-background/Overview.html?rev=1.6#layering


This is already implemented by Safari 3 and Opera 9.50 without any 
propriety prefixes. Multiple backgrounds use comma separated strings 
which you have used above. A Test case for multiple backgrounds.

http://css-class.com/test/css/backgrounds/multiple-backgrounds.htm


The fall-back or fall-forward switch must be something that non 
supporting implementations will throw out such a background like this 
test case.

http://css-class.com/test/css/backgrounds/background-switch.htm

The CSS is.

#container {
border:2px solid blue;
background: red / url(../../../images/examples/css3backc.png);
border-bottom:2px solid green;
height:200px;
width:200px;
}

Gecko 1.7 to 1.9, IE6 to IE8, Safari 3 and Opera 9.50 will just show a 
box with the borders as blue and the border-bottom green. What operates 
as a switch can not interfere with the parsing of the property and value 
appearing before or after the background string that is thrown out.

Testing in IE5.5 shows a red background and the borders (no harm done). 
Opera 9.10 to 9.25 will show the borders, red background and the 
transparent image. Since Anne proposed this switch (Which I really 
like), I hope he can assure that Opera 9.50 quickly replaces all the 
earlier versions of Opera in the wild. :-)


Alan

http://css-class.com/test/
Received on Sunday, 6 April 2008 13:04:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:04 GMT