W3C home > Mailing lists > Public > www-style@w3.org > July 2011

RE: background-image-frame

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Sat, 9 Jul 2011 19:47:11 +0000
To: Andrew Fedoniouk <news@terrainformatica.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <3C4041FF83E1E04A986B6DC50F0178290C57D9@TK5EX14MBXC297.redmond.corp.microsoft.com>

[Andrew Fedoniouk:] 
> It would be convenient if CSS will have 'background-image-frame: "string"
> '
> property. PNG and other image formats support annotated/taged/named sub-
> images so in principle they can be used as image-lists - single-file
> collections of multiple images / frames.
> 
> CSS "sprites" as a workaround are quite popular among Web designers but
> current solution [1] looks more like a hack rather than a solution.
> 
> This:
> 
>   #panel1b a { background: url(test-3.jpg) "normal" no-repeat; }
>   #panel1b a:hover { background-image-frame: "hover"; }
>   #panel1b a:active { background-image-frame: "active"; }
> 
> [1] http://www.alistapart.com/articles/sprites
> 
You can do this in IE9 using SVG; define a <viewBox> for each image, given them an ID
and reference them using a fragment e.g. background-image: url('./images.svg#third-frame');
Received on Saturday, 9 July 2011 19:47:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:42 GMT