Re: [css2.1] :first-line behvior

On Mar 19, 2008, at 1:40 PM, fantasai wrote:

>
> Bruce Lawson wrote:
>> At 19:16 19/03/2008, David Hyatt wrote:
>>> http://www.w3.org/TR/CSS21/selector.html#pseudo-elements
>>>
>>> "Pseudo-classes are allowed anywhere in selectors while pseudo-  
>>> elements may only be appended after the last simple selector of the
>>> selector."
>> I've seen this before, and often wondered: why?
>
> <p>This is a one-sentence <em>paragraph that
> has two lines</em> of text.</p>
>
> p::first-line em { display: block; }
>
> is one reason I can think of.
>
> ~fantasai
>

Nope, that's not a good enough reason, but nice try. The pseudo- 
elements define what properties are applicable to them, and for  
"first-line" it does not include "display":

The :first-line pseudo-element is similar to an inline-level element,  
but with certain restrictions. The following properties apply to  
a :first-line pseudo-element: font properties, color property,  
background properties, 'word-spacing', 'letter-spacing', 'text- 
decoration', 'vertical-align', 'text-transform', 'line-height',. UAs  
may apply other properties as well.

[the above is from http://www.w3.org/TR/CSS21/selector.html#first- 
line-pseudo ]

I would really like to see the "pseudo-elements may only be appended  
after the last simple selector" restriction lifted, as it is non- 
intuitive, and not forward thinking for future pseudo- elements that  
may need simple selectors to appear after them.

Received on Thursday, 20 March 2008 14:45:34 UTC