Hi,
Styling nested lists is no different form styling nested divs or anything else for that matter. You just have to keep an eye on what level you are at.
In your code you have this:
Code:
#menu #currentpage a {
color:#700;
padding-left:2px;
}
#menu ul li ul li #currentpage a {
color:#39F;
}
You were nearly right with the second rule but the id is attached to the list and you missed it. There would need to be another level for that to work.
It should be:
Code:
#menu #currentpage a {
color:#700;
padding-left:2px;
}
#menu ul li ul li#currentpage a {
color:#39F;
}
However you don't need to go overboard as you only need to be one level deeper than the first rule.
e.g.
Code:
#menu #currentpage a {
color:#700;
padding-left:2px;
}
#menu li li#currentpage a {
color:#39F;
}
or:
Code:
#menu #currentpage a {
color:#700;
padding-left:2px;
}
#menu li #currentpage a {
color:#39F;
}
Whether you use ul li ul depends on whether you are targeting the ul or the list. uls will contain nested uls and lists will also contain nested lists. It all depends on what element you want to hit.
You could say "ul li ul" but "li ul" is shorter and targets the same element because a nested ul will always be inside a list element.
You could also say "li ul li" but "li li" would again be shorter.
The rules would be the same for nested divs and if you said div {color :red} you would over-ride the inner element with div div {color:blue}.
Don't let it sound more complicated than it is.
Edit:
too slow....Raffles beat me
Bookmarks