Thanks to all who replied, and especially Jukka for the practical advice 
on my main issue (MSIE6 and below not 'getting' my long selectors).

Jukka's suggestion (assign a separate class to alternate li's) makes 
sense, but I thought that in this case I'd let those MSIE users suffer 
some ugliness, because I use these lists to display frequently-changing 
info, adding and subtracting li's. Alternate classes would require 
changing the code for each item when I add a new one.

But then I realized this would be true only if I delete a li from the 
middle (atypical), or if it's necessary for the first item to always be 
a particular shade (it's not).

This new method isn't as versatile or clever, but that's what we get for 
living with M$, right?

Jukka wrote:
> ...MSIE 5, 5.5., and 6 surely  don't support selectors like "li + li", 
> but they all let you set a background color for an li element.
>
> >  /* use container wrapper colors for 1st, 3rd, 5th, etc li's */
> > #containAbt .features li, #containAbt .features li+li+li, #containAbt
> > .features li+li+li+li+li, #containAbt .features li+li+li+li+li+li+li,
> > #containAbt .features li+li+li+li+li+li+li+li+li {
> >  background-color: #F7EFD5;
> > }
>
> That's flexible in a sense, but won't work on IE 6 or earlier due to lack
> of support to "+" in selectors, and it gets somewhat awkward.
>
> I'd suggest the simpler approach of assigning a class, say class="e", to
> the 2nd, 4th, 6th, etc. (i.e., even-numbered) list items and using a
> selector like
> .features li
> to cover all list items (effective making the settings you want for "odd"
> items) and then
> .features li.e
> to cover the "even" items. This is boring but gives much better browser
> coverage and avoids the problem of (mis)counting in li+li+li+...
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to