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

CSS3 missing selector

From: Dave Smith <smithd7@tcd.ie>
Date: Mon, 23 Mar 2009 12:40:43 +0000
To: <www-style@w3.org>
Message-ID: <001601c9abb0$f9bc70c0$ed355240$@ie>
Hi www-style

I believe there is a useful and yet missing selector. I'll explain by a
rough example:

<h1 or h>My section heading</h1 or h>

Given the above, to style the section content so that it is indented by
20px, but leave the heading with no margin can be done with:

..section > *:not(h1) {margin-left:20px;}

but what if the following could be done:

h1:content {margin-left:20px;}
A pseudo element wraps the content, based on heading scope, and is then


h1:section { }
A pseudo element wraps the heading and content, based on heading scope, and
is then styled.

Apart from being easy to read, one possible advantage is in backwards
compatibility with old documents (without section elements) that they could
be styled just as easily as new ones. Plus it just feels good, at least to

all the best
Dave Smith, 01 896 3976, smithd7@tcd.ie, Trinity Web Office
Please CC the Web Office, webdes@tcd.ie, in correspondence
Please note that electronic mail to, from, or within the College may be the
subject of a request under the Freedom of information Act
Received on Monday, 23 March 2009 12:42:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:25 UTC