what is the full word of “nth” in nth-of-type(1)?
I roughly guess ‘nth’ means "number " and th means ordinary
what is the full word of “nth” in nth-of-type(1)?
I roughly guess ‘nth’ means "number " and th means ordinary
nth is the full word.
It’s just a mathematical term for a number in a series.
I would interpret it as ‘n’ stands for “number” and ‘th’ is to make it an ordinal number, like fourth, fifth or sixth.
n’ stands for “number” and ‘th’ stands for ordinal indicator like 5th
nth-of-type(n) selector allows you to select one or more elements based on their source code,according to our need.
It is defined in the CSS Selectors Level 3 as “Structural Pseudo Class”-meaning it is used to style content based on its relationship with parent and sibling elements.
Ex:
p:nth-of-type(5) {
color: red;
}
So here Fifth paragraph will have color red.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.