Re: Generated content

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 UTC