Re: [css3-images] image() function and file formats

On Jan 19, 2011, at 9:13 AM, Alan Gresley wrote:

> On 20/01/2011 3:33 AM, Tab Atkins Jr. wrote:
>> On Tue, Jan 18, 2011 at 9:25 PM, Alan Gresley<alan@css-class.com>  wrote:
>>> On 19/01/2011 8:37 AM, Tab Atkins Jr. wrote:
> 
>>>> Right now, the image() function has a form of light type-sniffing via
>>>> the file extension, such that if the UA sees an image with an
>>>> extension corresponding to a type of image the UA *knows* it doesn't
>>>> support, it can skip trying to load the image altogether and just jump
>>>> to the next image in the list.
>>> 
>>> 
>>> Does this not work.
>>> 
>>> background: url(example.svg), url(example.png);
>> 
>> No, that's specifying multiple background images, which is a
>> completely different feature. It means that you want to download and
>> display both of them, with the example.svg on top.
>> 
>> ~TJ
> 
> 
> From a spec point of view that maybe correct but from an authors point of view, this is a way to serve a SVG background-image to a browser that supports SVG in background-image and allow the other browsers to just show the PNG (IE9 does not support SVG in background-image). That is why the SVG is on top.

Not that useful if there is transparency in the image though, as both images would show in UAs that supported both formats.

Received on Wednesday, 19 January 2011 17:24:51 UTC