W3C home > Mailing lists > Public > www-style@w3.org > May 2007

Re: last-letter and last-line Pseudo-Elements

From: Zoffix Znet <zoffix@zoffix.com>
Date: Mon, 14 May 2007 21:56:48 -0400
To: Christoph Päper <christoph.paeper@crissov.de>
Cc: www-style CSS <www-style@w3.org>
Message-Id: <1179194208.6698.17.camel@zoffix>

On Mon, 2007-14-05 at 22:25 +0200, Christoph Päper wrote:

> First off, |:first-letter| (and likewise a hypothetical |:last- 
> letter| selector) is a pseudo-class and not a pseudo-element and  
> therefore has only one colon (at least it was like that last time I  
> checked); |::before| and |::after| on the other hand are pseudo- 
> elements indeed.

No, :first-letter is pseudo-element. Pseudo-classes apply to DOM
elements which are in a specific state (mouse over it (:hover), focus on
it (:focus). 
However, if you would take for example:

<p>Lorem</p>  
p:first-letter{color: #abc; } 

:first-letter would apply to letter `L`, but it's just a letter not an
element. Therefore, the UA would do something like:
<p><pseudoelement>L</pseudoelement>orem</p> to apply styles to letter
`L`. Thus, :first-letter is a pseudo-element, not pseudo-class.

-- 
        Thank you for your time.
                Regards, Zoffix Znet
                ( http://zoffix.com , http://haslayout.net )
Received on Tuesday, 15 May 2007 01:56:55 GMT

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