Tag: Need greater than equals to represent pre round N+1 ret number
: Nth-child (2) Select the first few tags, "2 can be the number you want"
. demo01 li:nth-child(2) {background:#090}
: Nth-child (n+4) selects a value greater than or equal to 4, and "n" denotes an integer from the same
. demo01 li:nth-child(n+4) {background:#090}
: Nth-child (-n+4) Select less than or equal to 4 labels
. demo01 li:nth-child(-n+4) {background:#090}
: Nth-child (2n) Select even label, 2n can also be even
. demo01 li:nth-child(2n) {background:#090}
: Nth-child (2n-1) Select Odd Label, 2n-1 can be odd
. demo01 li:nth-child(2n-1) {background:#090}
: Nth-child (3n+1) custom selection label, 3n+1 means "two take one"
. demo01 li:nth-child(3n+1) {background:#090}
: Last-child Select Last Label
. demo01 Li:last-child{background:#090}
: Nth-last-child (3) Select the last number of labels, 3 means select the 3rd
. demo01 li:nth-last-child(3) {background:#090}
: These usages of nth-child are useful in practice and do not need to be individually labeled with ID or class
[CSS3]: Use of Nth-child