W3C home > Mailing lists > Public > www-style@w3.org > May 2001

Re: processing one element multiple times in CSS 2 or 3?

From: Andrew MacKinnon <andrew_mackinnon_2000@yahoo.com>
Date: Tue, 15 May 2001 20:24:09 +0000
Message-ID: <3B019069.159DC6C8@yahoo.com>
To: www-style@w3.org
Steve Tinney wrote:

> Given:
>         <a x="1" z="3"/>
>         <a x="6" y="2"/>
>         <a z="5"/>
> is there any CSS rule set *other than listing all possible permutations*
> which will enable processing of each of the attributes of <a> something like
> this:
>         a[x=1]:after { content: 'a'; }
>               a[x=6]:after { content: 'f'; }
>         a[y=2]:after { content: 'b'; }
>         a[z=3]:after { content: 'x'; }
>         a[z=5]:after { content: 'v'; }
> to produce:
>         ax
>         fb
>         v
> ?
> Or is this completely beyond the pale of CSS philosophy?

I don't think there is in CSS2. You could only do that if the content
after the <a> element was the same in all cases, in which case you'd use
comma-seperated list of the rules. I didn't see anything in CSS3 like
looking at the selectors module specification. You will just have to
list all
the possible possibilities. Even if you were dealing with numbers (for
height and width of images), there seems to be no equivalent of a
meaning "if greater or equal than X and lesser or equal than Y, then
apply this
style". Sorry.

Andrew MacKinnon

Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Received on Tuesday, 15 May 2001 16:24:12 GMT

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