W3C home > Mailing lists > Public > www-style@w3.org > December 2004

assigning multiple classes to achieve multiple backgrounds ?

From: Sander van Dragt <svandragt@s82.nl>
Date: Fri, 26 Nov 2004 19:51:57 +0100
To: www-style@w3.org
Message-Id: <200411261951.57231.svandragt@s82.nl>


I might be overlooking a obvious problem, but why does the background
property need multiple image values when instead we can already assign
multiple classes to a html tag?

<style type="text/css" media="screen">
#north {background: url(north.png) no-repeat 0% 50%;}
#east {background: url(east.png) no-repeat 50% 100%;}
#south {background: url(south.png) no-repeat 100% 50%;}
#west {background: url(west.png) no-repeat 50% 0%;}
</style>

<div class="north east south west">
[...]
</div>

There would be a problem with the fact that in current specifications
 the backgrounds would cancel each other out, so perhaps one would need
 to add a new background-attachment property named 'overlay' in
 addition to scroll and fixed (so north overlays east overlays south
 overlays west). However this would seem a very elegant solution.
 Perhaps I've missed some obvious problem with this technique though..

--
Best regards,
Sander van Dragt

Poetry is the language in which man explores his own amazement.
Christopher Fry
Received on Tuesday, 7 December 2004 09:45:59 GMT

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