Previous Message
Next Message

Re: [css-d] first-line applied to only first element

Sent by Chris Casciano on 28 January 2002 12:12

on 1/28/02 12:27 PM, Mark Newhouse at [EMAIL-REMOVED] wrote:

> on 1/27/02 11:43 AM, Porter Glendinning at [EMAIL-REMOVED] wrote:
>>> how can i get the first <p> in the <div> (which has an id) to accept
>>> a first-line property *without* it cascading to all other <p>s in the
>>> <div>?
>> I believe something like this is the selector syntax you're looking
>> for:
>> div#id > p:first-child::first-line
>> Don't be surprised, however, if browser support is, shall we say,
>> "interesting."
> How about:
>   #id p+p:first-line {
>       font-weight: normal;
>       font-family: verdana;
>       }
> Worked on all Standards Compliant browsers I have on my Mac (IE5, Moz9.7,
> Opera5)
> I used the adjacent sibling combinator to accomplish this. Note that if any
> other tag (IMG, Hx, etc.) comes between your P tags, then the p:first-line
> styling will take over for that paragraph...

Mark, this is the way I would have answered the question. Unfortunately,
IE6/pc doesn't like the "+" selector. And we all know what not working in
IE/PC means in the "real world".

Chris Casciano                  home >>
                                words >
[EMAIL-REMOVED]       fun >>>
Previous Message
Next Message

Message thread: