W3C home > Mailing lists > Public > www-style@w3.org > January 2002

Re: Proposal for new `any of these elements' selector type

From: Jonas Sicking <sicking@bigfoot.com>
Date: Wed, 2 Jan 2002 22:22:03 +0100
Message-ID: <007301c193d3$86383e60$b3e0d0d9@telia.com>
To: "Matthew Thomas" <mpt@mailandnews.com>, <www-style@w3.org>
fantasai wrote:
> Matthew Thomas wrote:
> >
> > The cause of the problem is that instead of just selecting on UL, we're
> > selecting on UL or OL or DIR or MENU. And while CSS allows selecting on
> > one element (NameOfElementHere) or all elements (*), it does not allow
> > selecting on a particular subset of elements.
> >
> > So, I thought, why not introduce `any of these elements' syntax into
> > CSS? Then all the above html.css code could be replaced with only three
lines:
> > |
> > |                                   ul {list-style-type: disc;}
> > |                  (ul,ol,menu,dir) ul {list-style-type: circle;}
> > | (ul,ol,menu,dir) (ul,ol,menu,dir) ul {list-style-type: square;}
> >
> > Discuss amongst yourselves. :-)
>
> This can be done with the :matches() proposal -
>
>                                                   ul {list-style-type:
disc;}
>                          :matches(ul,ol,menu,dir) ul {list-style-type:
circle;}
> :matches(ul,ol,menu,dir) :matches(ul,ol,menu,dir) ul {list-style-type:
square;}

Actually, it can be done using the :not() pseudo-class:

ul {list-style-type: disc;}
:not(:not(ul):not(ol):not(menu):not(dir)) ul {list-style-type: circle;}
:not(:not(ul):not(ol):not(menu):not(dir))
:not(:not(ul):not(ol):not(menu):not(dir)) ul {list-style-type: square;}

It's not very pretty though...

/ Jonas Sicking
Received on Wednesday, 2 January 2002 16:16:42 GMT

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