Question

Let's say for example I have the following list:

    <ul>
        <li><a>Explore</a></li>
        <li><a>About</a></li>
        <li><a>Contact</a></li>
        <li><a>Blog</a></li>
        <li><a>blah</a></li>
        <li><a>boo</a></li>
        <li><a>ahh</a></li>
    </ul>

How do I control all items after List item number four?

Était-ce utile?

La solution

King King gave the answer, for example:

ul > li:nth-child(n+5) {
    color: blue;
}

See demo at: http://jsfiddle.net/audetwebdesign/7yVKS/

Reference: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top