Previous Message
Next Message

Re: [css-d] Psuedo class inheritance/IE6 bug(?)

Sent by John Albin Wilkins on 25 January 2002 14:02


on 1/24/2002 21:06, Eric A. Meyer at [EMAIL-REMOVED] wrote:

> At 19:26 -0500 1/24/02, Chris Casciano wrote:
> 
>> Instead of the expected result - the first letter of the paragraph being
>> blue, 40px & Georgia - I ended up with a 40px black Arial first letter. A
>> built example can be found here:
>> 
>> http://placenamehere.com/css-discuss/psuedo_test.html
>> 
>> Any thoughts on the matter? Does anyone out there think this is anything
>> more then a bug in IE6?
> 
> It seems like a bug in IE6, but I'm not entirely certain yet--
> could you send me a snapshot of the behavior offlist?  Porter's
> corrective e-mail is correct; the '*' rule does NOT apply to the
> pseudo-element because only element can be selected.  Note I don't
> say "styled," I say "selected."  For example, the selector
> 'p#test:first-line' selects a paragraph element with an 'id' of
> 'test', and then causes only its first line to be styled.  But it's
> the element that is selected.

Eric is correct.  I'm certain because I looked it up in the CSS2 spec.  IE6
has a bug in it.

Specifically, CSS2 Sec 5.3 says, "The universal selector, written '*',
matches the name of any element type.  It matches any single element in the
document tree."  CSS2 Sec 5.10 says, "Neither pseudo-elements nor
pseudo-classes appear in the document source or document tree."  So, *
doesn't match on pseudo-classes or pseudo-elements.


Of course, wouldn't you be better off replacing "*" in your style sheet with
"body"?  That way the "body" styling will be inherited throughout the
document and the "p" styling will be inherited throughout the paragraph.

For instance, using your original style sheet:
    * { font-family: Arial, sans-serif; font-size:14px; color:#000000;
        background-color:#FFFFFF;}
    p { font-family: Georgia, serif; color:#0000FF; }
    p:first-letter { font-size: 30px; }

The html "<p>Hello, Chris! How <em>are</em> you?</p>" would have the word
"are" displayed in black Arial (and italic) with the rest of the paragraph
in blue Georgia.  But, then, maybe you <em>do</em> want that?

 - John Albin Wilkins
Previous Message
Next Message

Message thread: