CSS3 Selectors: Structural pseudo class :nth-child(n)

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

E:nth-child(n):-  This is a structural pesudo-class.

An E element, the n-th child of its parent.

We use the example below to format the second paragraph with the <p> tag.

This is done by div#introduction p:nth-child(2).

<!DOCTYPE html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title>HTML Table</title>
        div#introduction p:nth-child(2) {
            font-size: 22px;
            color: blue;
            font-family: Arial;
<div id='introduction'>
    <p>Ushuaia is the capital of Tierra del Fuego, Antártida e Islas del Atlántico Sur Province.</p>

    <p>It is commonly regarded as the southernmost city in the world.</p>

    <p>Ushuaia is located in a wide bay on the southern coast of Isla Grande de Tierra del Fuego, bounded on the north
        by the Martial mountain range and on the south by the Beagle Channel.</p>


Series Navigation<< CSS3 Selectors: Last-child
CSS3 Selectors: nth-child >>

Leave a comment

Leave a Reply