Reputation: 1017
I have an html menu, that start like this:
<nav id='main'>
<ul>
and my CSS file goes like this:
nav #main ul {
list-style: none;
}
But for some reason, this does not seem to work... What am I doing wrong?
Upvotes: 2
Views: 91
Reputation: 50193
Space is descendant selector.
You are trying to apply this style to:
<ul>
descendants from an object with id="main"
that is descendant of a <nav>
object.You should instead apply the style to:
<ul>
descendants from a <nav>
object with id="main"
.It can be done removing the first space:
nav#main ul {
list-style: none;
}
Upvotes: 6
Reputation: 38147
Try using
nav#main ul {
list-style: none;
}
ie remove the space between nav
and #main
- using the space is indicating #main
is a descendant of nav
instead of saying #main
is an id attribute of nav
See the docs here for pattern matching in CSS2
Upvotes: 7