Previous Message
Next Message

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

Sent by Chris Casciano on 24 January 2002 21:09


on 1/24/02 8:18 PM, Porter Glendinning at [EMAIL-REMOVED] wrote:

> At 07:26 PM 1/24/02, Chris Casciano digitized these thoughts:
>> * { 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; }
>> 
>> 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
> 
> Actually, this is the correct interpretation of your rule sets
> (surprisingly). If you read the section of the CSS2 Recommendation on
> pseudo-elements [1] you'll see that the recommended handling of the
> :first-line and :first-letter pseudo-elements is for the browser to
> create a fictitious element within the real element.
> 
> What this means is that, when parsed by the browser, the code for your
> paragraph would likely be turned into something like this:
> 
>    <p><p:first-line><p:first-letter>T</p:first-letter>his is a
>    test paragraph whose characters are expected to be all
>    blue.</p:first-line></p>
> 
> Because of this, the properties you set in the * rule set (which
> matches any element) end up overriding  the ones you've set for the p
> element the same way as if you had any other elements embedded within
> that paragraph.
> 

Well, that being the case it appears we have another case of what was the
w3c thinking. (Glad I asked). I say this not because I don't understand
their rationalization, but because it (a) works differently from the way I'd
expect but also and more frustratingly (b) works differently then the
psuedo-classes I'm used to using like :hover, yet shares the same syntax.

(example of * and hover in action here:
http://placenamehere.com/css-discuss/psuedo_test_hover.html )

> Interestingly, Mozilla 0.9.7 doesn't behave this way; it shows the
> initial cap in blue Georgia. I haven't been able to find anything that
> says whether the fictitious element implementation above is required
> for CSS2 conformance, though. If it is, this should probably be
> submitted to Bugzilla for fixing, if it hasn't already.
> 

In addition to my test with moz 0.9.7, IE5.1.3/OS X and Opera 5.11/PC &
Opera 6PC also show the behavior I had expected. Opera5b3 and icab on OS X
both gave me partial results. I guess a bunch of folks have some work to do.

-- 
Chris Casciano                  home >> http://www.placenamehere.com/
                                words > http://www.chunkysoup.net/
[EMAIL-REMOVED]       fun >>> http://www.neuralust.com/~cac6982/
Previous Message
Next Message

Message thread: