W3C home > Mailing lists > Public > www-style@w3.org > February 2000

Re: Generated content

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Fri, 4 Feb 2000 14:08:36 -0500 (EST)
Message-Id: <200002041908.OAA00599@is02.fas.harvard.edu>
To: www-style@w3.org
On Fri, 04 Feb 2000 13:48:58 -0800, Matthew Brealey
(thelawnet@yahoo.com) wrote:
> 
> > Re: Generated content
> > 
> > From: Ian Hickson (py8ieh@bath.ac.uk)
> > >>> This fails to define the rendering of
> > >>>    P.note:before { content: "Note: "; display: block; }
> > >>>    P.note        { border: solid green }
> > >>> - does the border cover the block before.
> > >>>
> > >>> The spec does not say whether it does. Clearly the best answer is
> > >>> no, [...]
> > >>
> > >> (Clearly?)
> > >>
> > >> The answer is actually yes.
> > > Spec reference please - I don't think it is possible to say for
> > > certain either way.
> > 
> > Section 12.1:
> > # [The] :before and :after pseudo-elements specify the location of
> > # content before and after an element's document tree content.
> That doesn't, I fear, answer my question.

It does, since the content is inserted adjacent to the element's document
tree content (and thus within the element).  However, the next normative
paragraph in section 12.1 of CSS2 answers this question explicitly:

# The formatting objects (e.g., boxes) generated by an element include
# generated content.

The names :before and :after are slightly misleading.  They don't mean
"inserted before" and "inserted after", but rather mean "inserted as
first child" and "inserted as last child."

-David
Received on Friday, 4 February 2000 14:08:37 GMT

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