سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top