<ul>
<li>This
<li>and this</li>
</li>
</ul>
I try to select the second <li>
by doing:
li li {
background: "red";
}
Why doesn't it work?
<ul>
<li>This
<li>and this</li>
</li>
</ul>
I try to select the second <li>
by doing:
li li {
background: "red";
}
Why doesn't it work?
You are missing one ul... And the document is not valid HTML5. Try this one (this is a proper way of nesting lists):
<ul>
<li>This
<ul>
<li>and this</li>
</ul>
</li>
</ul>
Then in CSS:
ul li ul li {
background: "red";
}
More to read here: Proper way to make HTML nested list?
Best regards, hope it helps!