css code snippet to explain: nth-child() & nth-of-type()

PHOTO EMBED

Tue Nov 22 2022 06:34:06 GMT+0000 (Coordinated Universal Time)

Saved by @Tejkumar #css

/* Universal Selector */

* {
    margin: 0;
    padding: 0;
    background-color: gray;
}

.container {
    margin: 100px;
    line-height: 50px;
    margin-left: 600px;
    font-size: xx-large;
}

div li:nth-child(2) {
    color: dodgerblue;
}

div li:nth-of-type(3) {
    color: red;
}
content_copyCOPY

styling applied to explain nth-child() & nth-of-type()