CSS3 Selectors: nth-last-of-type

This entry is part 35 of 40 in the series CSS3 Selectors

If you notice, the following setup will actually target the first paragraph of the <section> tag.

<!DOCTYPE html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title>Codecrawl.com - HTML5</title>
        section p:nth-last-of-type(2) {
            color: blue;

        <h1>Rod Stewart</h1>

        <h4>Sing It For Us Rod</h4>
        <p>Rod Stewart is one of the best-selling music artists of all time</p>

        <p>Having sold over
            100 million records worldwide.</p>


Series Navigation<< CSS3 Selectors: nth-of-type
CSS3 Selectors: Only-of-type >>

Leave a comment

Leave a Reply