CSS Code "div:nth-child(odd)"

Hello Buddies,

The syntax below stated that “For every div child of the #container the command will be the following…”
but What is the meaning of “nth” and “odd”?

#container > div:nth-child(odd) {


***Please explain briefly

Thanks in Advance,

This means that in the div with an id of container, if it has children divs, the direct children divs which are odd numbers (1, 3, 5, etc) should be affected by whatever styling you apply inside the parentheses.


Check out this example. Hope that helps.

The answer is here https://www.w3schools.com/cssref/sel_nth-child.asp