RFE: CSS3 Selectors: Parent combinators

Request For Enhancement - CSS3 Selectors - Parent combinators.

A parent combinator describes a parenthood relationship between two
elements. A parent combinator is made of the "less-than sign" (<)
character and separates two sequences of simple selectors.

Example: 

The following selector represents a <section> element that is parent of
an <h> element:

h < section

This would allow you to do something like the following:

h < section {
  padding-top: 0;
}

That rule would eliminate the padding at the top of any <section>
containing an <h> element, such as the first <section> in the following
document fragment:

<body>
  <section>
    <h>My Example Heading</h>
    <p>Example paragraph text.</p>
  </section>
  <section>
    <p>Example paragraph text.</p>
    <p>Example paragraph text.</p>
    <p>Example paragraph text.</p>
  </section>
</body>

On a related note, an "Ascendant combinator" ('/' ?) might be a nice
touch too.  Though, unlike Parent, I personally haven't bumped into the
want for one yet.

-- 
Chris Hubick
mailto:chris@hubick.com
http://www.hubick.com/

Received on Friday, 24 January 2003 19:14:24 UTC