Re: pseudo-selectors

On Tue, 29 Apr 2003, [iso-8859-1] Joachim Noreiko wrote:
> Going by what I see in practice, I have a couple of ideas.

You'll be glad to know that some of your ideas have already been addressed
by the working group. In the near future we hope to release the CSS3
Generated and Replaced Content Module, which will include proposals very
similar to what you describe.

> 1. ::interior pseudo-element
> the contents of the element.
> The motivation behind this is all the HTML pages that use
>  <h1><span>heading text</span></h1>
> because they want to apply background / border styling
> to just the text and not a full-width box.
> this pesudo-element would allow:
>  h1::interior
> to select that text instead of the <span> element.

The module I referred to above includes an '::outside' pseudo-element
which would let you write:

   h1::outside { display: block; }
   h1 { display: inline; border: solid; }

> 2. :between pseudo-class
> selects a fictional box between all successive occurences of the class.
> eg:
>  h3:between
> would create several fictional DIV boxes each like
> this:
>  <h3>...</h3><DIV (fictional)>
>  ...
>  </DIV><h3>...</h3>

An interesting idea. The draft doesn't have anything quite like this, but
it does have similar ideas... You could probably do the above using:

   h3:not(:last-of-type) ~ * { move-to: between; }
   h3::outside { display: block; }
   h3::outside::before { display: block; content: pending(between); }

...which would end up wrapping all the content between <h3>s into the
h3::outside::before pseudo-element. Admittedly it is a little more
complicated. :-)

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.                         `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 29 April 2003 12:25:57 UTC