Previous Message
Next Message

Re: [css-d] Dueling pseudoclasses?

Sent by Eric A. Meyer on 29 January 2002 16:04


At 15:57 -0500 1/29/02, Joe Howley wrote:

>>    Actually, it's a bug in Opera that it has an effect here, and IE 
>>and NS are right to ignore it.  From CSS2:5.12.2: "The 
>>':first-letter' pseudo-element matches parts of block-level 
>>elements only."  'a' is an inline element, unless of course you use 
>>'display' to make it block-level.
>
>I feared it was something like that.
>So how would I use display to do that, exactly?

    div#linky a {display: block;}
    div#linky a:first-letter {color: yellow;}

...or words to that effect.  This is how I created the sidebar links 
on css/edge, meyerweb.com, and the Evangelism section of DevEdge. 
Note that having <br> elements between block-level elements may push 
them apart.  My solution on css/edge and DevEdge was to move the 
<br>s inside the links.  On meyerweb.com, I just dropeed them, since 
I want the links to be written in a single line (instead of 
vertically stacked) 	in older browsers anyway.

--
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff
Previous Message
Next Message

Message thread:

Possibly related: