Re: first-letter tag soup

L. David Baron writes:
> Section 5.12.2 of CSS2 [1] says that first-letter pseudo-elements
> should include punctuation preceding the first letter of the paragraph.
> It also says that the formatting of the first-letter pseudo-element
> can be understood by placing a :first-letter element immediately
> around the first letter of the paragraph.  It gives the following
> example:
> 
> # <P>
> # <SPAN>
> # <P:first-letter>
> # T
> # </P:first-letter>he first
> # </SPAN> 
> # few words of an article in the Economist.
> # </P>
> 
> However, what happens to markup like:
> 
> <p>[<span>Text</span>]</p>
> 
> Both the '[' and the 'T' should be included in the first-letter
> pseudo-element.  This can't form a tree structure.  So how is that
> pseudo-element formatted?  What inherits from what?  Where do borders
> and backgrounds go (on both the span and the first-letter)?
> 
> The only solution I can think of would be that if such a thing were to
> happen, there should be no first-letter pseudo-element for that block.

That is IMHO a valid conclusion. It is OK to give up and not honour a
:first-letter if the situation is too complex.

There is a lot of "should" and "may" in section 5.12.2. The "tag soup" 
is not meant as the definition of the first-letter pseudo-element. It
is only there as a hint, precisely because you cannot always make a
tree structure out of the typographic structure.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Tuesday, 11 January 2000 07:24:34 UTC