Subject: [css-d] Select first LI of an UL

From: gleemax at attbi.com (John Lewis)
Date: Thu, 24 Apr 2003 22:25:09 -0500

Arlen wrote on Tuesday, April 22, 2003 at 9:51:54 AM:

> li {font-weight: bold;}
> li + li {font-weight:normal}

> [...] When it fails, the entire list will be bolded, so perhaps
> you'll want to combine it with a hack that screens out those
> browsers from seeing the initial bold styling.

This should have a better success rate, and it's not really a hack
(i.e., it makes common sense, even if it is a bit longer):

    ul>li{font-weight:bold}
    ul>li+li{font-weight:normal}

There aren't many browsers that support child selectors without
supporting adjacent sibling selectors.

-- 
John Lewis