Skip to content

Commit 8c21696

Browse files
Added alternative for negative nth-child 🙌🏼
1 parent d28d5dd commit 8c21696

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ li:nth-child(-n+3) {
112112
}
113113
```
114114

115+
Or, since you've already learned a little about [using `:not()`](#use-not-to-applyunapply-borders-on-navigation), try:
116+
117+
```css
118+
/* select items 1 through 3 and display them */
119+
li:not(:nth-child(-n+3)) {
120+
display: none;
121+
}
122+
```
123+
115124
Well that was pretty easy.
116125

117126

0 commit comments

Comments
 (0)