回答編集履歴
1
>
test
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
共通の親に `class="parent"` が付いているとして、
|
4
4
|
```css
|
5
|
-
.parent :nth-child(5n+1) {
|
5
|
+
.parent > :nth-child(5n+1) {
|
6
6
|
color: red;
|
7
7
|
}
|
8
|
-
.parent :nth-child(5n+2) {
|
8
|
+
.parent > :nth-child(5n+2) {
|
9
9
|
color: green;
|
10
10
|
}
|
11
|
-
.parent :nth-child(5n+3) {
|
11
|
+
.parent > :nth-child(5n+3) {
|
12
12
|
color: orange;
|
13
13
|
}
|
14
|
-
.parent :nth-child(5n+4) {
|
14
|
+
.parent > :nth-child(5n+4) {
|
15
15
|
color: blue;
|
16
16
|
}
|
17
|
-
.parent :nth-child(5n) {
|
17
|
+
.parent > :nth-child(5n) {
|
18
18
|
color: yellow;
|
19
19
|
}
|
20
20
|
```
|