The CSS nth-of-type(n) selector matches every element of a specific type that is the child of its parent.
n
can be any of the following:
- number
- keyword
- formula.
: nth-of-type(number) {
// css
}
The code below shows how different stylings can be applied to different paragraphs based on their nth value.
Free Resources