Structural selectors in CSS
Selecting by position: every other row, the first few, the last one.
tbody tr:nth-child(2n) {
background: rgb(255 255 255 / 3%);
}
.steps li:nth-child(-n + 3) {
font-weight: 600;
}
.chips > *:last-child {
margin-inline-end: 0;
}
p:first-of-type::first-line {
letter-spacing: 0.04em;
}
How it works
nth-child(2n)is every second child.nth-child(-n + 3)takes the first three.nth-of-typecounts only siblings of the same element.
Keywords and builtins used here
backgroundchipsemrgbsteps
The run, in numbers
- Lines
- 15
- Characters to type
- 218
- Tokens
- 61
- Three-star pace
- 70 tpm
At the three-star pace of 70 tokens a minute, this run takes about 52 seconds.
Step 6 of 6 in Selectors, step 6 of 26 in Selectors & the box model.