W3C home > Mailing lists > Public > www-style@w3.org > March 2006

Attribute Comparison Selectors

From: ben <arcticmac@comcast.net>
Date: Thu, 16 Mar 2006 04:23:24 +0000
Message-Id: <p06230907c03e956bbbb9@[192.168.11.4]>
To: www-style@w3.org




I'm working on a timeline project in markup language (HTML currently, 
but I was considering expanding to XML)

I'd like to be able to color code the events.  This can, of course, 
be done with CSS as it is currently, by assigning each era a specific 
value of an attribute (either class or some custom attribute). 
However, it seems like the ideal way to do it would be to have a date 
attribute, (this much can be done in XML)  and have a css selector 
that can do things like ranges.  Currently, selectors only allow for 
checking to see if an attribute exists, if it is a particular string, 
or if it contains (or starts with or ends with) a particular string. 
What I would propose would be a selector for numerical attributes 
only, something like this:

*[attribute|>number|<number]

So, for example, if I were to markup

event[date|>1849|<1914] {background: #00ff00;}

Any event between 1849 and 1914 would have a green background.

Just a thought...  do with it as you see fit.
Received on Friday, 17 March 2006 17:29:45 GMT

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