:first-letter and :before in CSS2

Germain Garand germain at ebooksfrance.org
Wed Mar 22 20:28:30 GMT 2006


Le Mercredi 22 Mars 2006 18:58, Charles Samuels a écrit :
> Is :first-letter supposed to match text created by :before { content: } ?
>
> If the standard doesn't say so explicitly, and arguably:
>
> According to http://www.w3.org/TR/CSS21/selector.html#first-letter
> 	"The first letter of a table-cell or inline-block cannot be the first
> letter of an ancestor element"
>
> Implies that <div><span:before>F</span>irst letter</div> implies that it
> wouldn't match.

if the span is default style here, it's an inline flow, not an inline-block, 
so it would match (:before elements inherit the display property)

>
> Can I assume that it doesn't match because it'd be easier to implement? :)
>

no, it's really supposed to match... 5.12.3 has an example of that (which is 
in the regression suite).
But it works fine in current KHTML, AFAIK?

Germain




More information about the kfm-devel mailing list