回答編集履歴

1

コード追記

2020/04/13 02:47

投稿

hatena19
hatena19

スコア33742

test CHANGED
@@ -35,3 +35,99 @@
35
35
  }
36
36
 
37
37
  ```
38
+
39
+ ---
40
+
41
+ **蛇足**
42
+
43
+
44
+
45
+ `transition`でも同様のことは可能です。
46
+
47
+
48
+
49
+ ```css
50
+
51
+ input.nav_bar ~ .header_menu > a {
52
+
53
+ top: -25px;
54
+
55
+ opacity: 0;
56
+
57
+ }
58
+
59
+
60
+
61
+ input.nav_bar:checked ~ .header_menu > a {
62
+
63
+ top: 0;
64
+
65
+ opacity: 1;
66
+
67
+ }
68
+
69
+
70
+
71
+ input.nav_bar ~ .header_menu > a:nth-child(1) {
72
+
73
+ transition: all 0.3s ease-in-out 0s;
74
+
75
+ }
76
+
77
+ input.nav_bar ~ .header_menu > a:nth-child(2) {
78
+
79
+ transition: all 0.3s ease-in-out 0.05s;
80
+
81
+ }
82
+
83
+ input.nav_bar ~ .header_menu > a:nth-child(3) {
84
+
85
+ transition: all 0.3s ease-in-out 0.1s;
86
+
87
+ }
88
+
89
+ input.nav_bar ~ .header_menu > a:nth-child(4) {
90
+
91
+ transition: all 0.3s ease-in-out 0.15s;
92
+
93
+ }
94
+
95
+ input.nav_bar ~ .header_menu > a:nth-child(5) {
96
+
97
+ transition: all 0.3s ease-in-out 0.2s;
98
+
99
+ }
100
+
101
+
102
+
103
+ input.nav_bar:checked ~ .header_menu > a:nth-child(5) {
104
+
105
+ transition: all 0.3s ease-in-out 0s;
106
+
107
+ }
108
+
109
+ input.nav_bar:checked ~ .header_menu > a:nth-child(4) {
110
+
111
+ transition: all 0.3s ease-in-out 0.05s;
112
+
113
+ }
114
+
115
+ input.nav_bar:checked ~ .header_menu > a:nth-child(3) {
116
+
117
+ transition: all 0.3s ease-in-out 0.1s;
118
+
119
+ }
120
+
121
+ input.nav_bar:checked ~ .header_menu > a:nth-child(2) {
122
+
123
+ transition: all 0.3s ease-in-out 0.15s;
124
+
125
+ }
126
+
127
+ input.nav_bar:checked ~ .header_menu > a:nth-child(1) {
128
+
129
+ transition: all 0.3s ease-in-out 0.2s;
130
+
131
+ }
132
+
133
+ ```