-
1. Re: :last-child vs :first-child -- How do I isolate last item in a list?
MurraySummers Nov 7, 2011 12:54 PM (in response to mookie blaylock)Well, the ">" selector selects a direct child. I suspect that's why the first item is selected.
Why not try this - (assuming you have 5 list elements)
#menu ul li + li + li + li + li { background-color:#FFF; }
There is a danger associated with using the background (and a few other) shorthands without explicitly specifying all of the shorthand values. Thus, I think it's a bad practice to use this shorthand when you are only specifying color.
-
2. Re: :last-child vs :first-child -- How do I isolate last item in a list?
MurraySummers Nov 7, 2011 1:02 PM (in response to MurraySummers)Actually make that this
#menu ul li + li + li + li + li a { background-color:#FFF; }
and I believe it'll work.
-
4. Re: :last-child vs :first-child -- How do I isolate last item in a list?
pziecina Nov 7, 2011 1:37 PM (in response to mookie blaylock)Hi
The css for your menu is also being applied via javascript, which maybe overwriting your css rule.
PZ
-
5. Re: :last-child vs :first-child -- How do I isolate last item in a list?
MurraySummers Nov 7, 2011 1:41 PM (in response to mookie blaylock)Change this -
#menu ul li + li + li + li + li + li + li a { background-color:#FFF; }
to this -
#menu ul li + li + li + li + li + li + li a { background-color:#FFF;background-image:none; }
-
6. Re: :last-child vs :first-child -- How do I isolate last item in a list?
mookie blaylock Nov 7, 2011 1:56 PM (in response to MurraySummers)#menu ul li + li + li + li + li + li + li a,
#menu ul li + li + li + li + li + li + li a:hover { background-color:#FFF;background-image:none; }
seems to do the trick! Thank you, Murray. This navbar has been plaguing me for far too long...
-
7. Re: :last-child vs :first-child -- How do I isolate last item in a list?
mookie blaylock Nov 14, 2011 11:45 AM (in response to mookie blaylock)Hi, Murray
When I'm on the contact page: http://mayakaimal.businesscatalyst.com/contact How do I turn off the red dot? I've tried #menu ul li + li + li + li + li + li + li a:active, :selected, :focus to no avail.
thanks,
mookie
-
8. Re: :last-child vs :first-child -- How do I isolate last item in a list?
MurraySummers Nov 14, 2011 12:42 PM (in response to mookie blaylock)Which button is the contact page? If it's the third button, use -
#menu ul li + li + li a:hover
if it's the 5th button, use -
#menu ul li + li + li +li + li a:hover
etc.
The "li + li" parade there is selecting 'adjacent sibling' <li> elements. You just have to make sure you have selected the right nth one.
-
9. Re: :last-child vs :first-child -- How do I isolate last item in a list?
mookie blaylock Nov 14, 2011 2:47 PM (in response to MurraySummers)It's not the hover state. I already have that in there. It's the selected state. When you are ON the contact page, the red dot is fixed. It goes away when you hover.
-
10. Re: :last-child vs :first-child -- How do I isolate last item in a list?
mookie blaylock Nov 14, 2011 3:20 PM (in response to mookie blaylock)It's:
#menu ul li + li + li + li + li + li + li.selected



