Reputation: 1150
I think that is a very simple problem, but I don't seem to get it right. I want to style a list using css, but I ably want to effect the "top level < li > elements.
HTML
<ul class="test">
<li>1</li>
<li>2
<ul>
<li>2.1 - should not be red</li>
<li>2.2 - should not be red</li>
</ul>
</li>
<li>3</li>
CSS
.test > li {
color: #f00;
}
What am I doing wrong? Thanks a lot!
Upvotes: 0
Views: 39