質問編集履歴
2
質問追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -277,3 +277,21 @@
|
|
277
277
|
|
278
278
|
|
279
279
|
出来れば急ぎで教えて頂きたいです。。。
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
おそらく、
|
284
|
+
|
285
|
+
.h-list:last-child a {
|
286
|
+
|
287
|
+
color:#fff;
|
288
|
+
|
289
|
+
}
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
が影響していると思うのですが、親要素?のliの最後だけに設定したのに、
|
294
|
+
|
295
|
+
子要素のsub-menu-itemにも影響してしまいます。
|
296
|
+
|
297
|
+
sub-menu-itemには影響しないようにする方法を教えて頂ければ解決するかもです。
|
1
html、css追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,60 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
+
.h-menu{
|
28
|
+
|
29
|
+
display: flex;
|
30
|
+
|
31
|
+
align-items: center;
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
.h-list{
|
40
|
+
|
41
|
+
display: inline-block;
|
42
|
+
|
43
|
+
font-weight: bold;
|
44
|
+
|
45
|
+
text-decoration: none;
|
46
|
+
|
47
|
+
//text-align: center;
|
48
|
+
|
49
|
+
position: relative;
|
50
|
+
|
51
|
+
//padding: 0px 6px;
|
52
|
+
|
53
|
+
//margin: 23px 16px;
|
54
|
+
|
55
|
+
//margin: 0px 16px;
|
56
|
+
|
57
|
+
padding: 23px 12.5px 24px 18px;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
.h-list a{
|
66
|
+
|
67
|
+
color: #333;
|
68
|
+
|
69
|
+
text-decoration: none;
|
70
|
+
|
71
|
+
//padding: 23px 18px 23px 23px;
|
72
|
+
|
73
|
+
display: block;
|
74
|
+
|
75
|
+
//padding: 23px 12.5px 24px 18px;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
|
27
81
|
.h-list a::before {
|
28
82
|
|
29
83
|
content: "";
|
@@ -42,10 +96,176 @@
|
|
42
96
|
|
43
97
|
}
|
44
98
|
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
.h-list:last-child {
|
104
|
+
|
105
|
+
background: #2498b3;
|
106
|
+
|
107
|
+
list-style: none;
|
108
|
+
|
109
|
+
font-weight: bold;
|
110
|
+
|
111
|
+
//margin-left: 1.5px;
|
112
|
+
|
113
|
+
//padding: 0px 6px 0;
|
114
|
+
|
115
|
+
text-decoration: none;
|
116
|
+
|
117
|
+
//color: #fff;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
.h-list:last-child a {
|
124
|
+
|
125
|
+
color:#fff;
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
ul {
|
134
|
+
|
135
|
+
list-style: none;
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
.sub-menu-item a{
|
144
|
+
|
145
|
+
background:#E9F8FB;
|
146
|
+
|
147
|
+
padding: 0px 20px 0px 15px;
|
148
|
+
|
149
|
+
// padding: 10px 20px 10px 15px;
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
.sub-menu-item a:hover{
|
156
|
+
|
157
|
+
background: #fff;
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
.sub-menu {
|
166
|
+
|
167
|
+
position: absolute;
|
168
|
+
|
169
|
+
top: 74px;
|
170
|
+
|
171
|
+
width: auto;
|
172
|
+
|
173
|
+
font-weight: normal;
|
174
|
+
|
175
|
+
line-height: 3.5;
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
.h-list:hover > .sub-menu > .sub-menu-item {
|
184
|
+
|
185
|
+
overflow: visible;
|
186
|
+
|
187
|
+
opacity: 1;
|
188
|
+
|
189
|
+
height: 55px;
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
.sub-menu-item {
|
194
|
+
|
195
|
+
overflow: hidden;
|
196
|
+
|
197
|
+
opacity: 0;
|
198
|
+
|
199
|
+
height: 0;
|
200
|
+
|
201
|
+
white-space: nowrap;
|
202
|
+
|
203
|
+
//padding: 10%;
|
204
|
+
|
205
|
+
transition: 0.2s;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
.sub-text {
|
214
|
+
|
215
|
+
display: inline-block;
|
216
|
+
|
217
|
+
transition: all .3s ease 0s;
|
218
|
+
|
219
|
+
text-decoration: none;
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
.sub-text:hover {
|
226
|
+
|
227
|
+
cursor: pointer;
|
228
|
+
|
229
|
+
color: #2498b3;
|
230
|
+
|
231
|
+
}
|
232
|
+
|
45
233
|
```
|
46
234
|
|
47
235
|
|
48
236
|
|
237
|
+
```html
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<li class="h-list">
|
242
|
+
|
243
|
+
<a href="#">あああああ</a>
|
244
|
+
|
245
|
+
<ul class="sub-menu">
|
246
|
+
|
247
|
+
<li class="sub-menu-item"><a class="sub-text" href="#">いいい</a></li>
|
248
|
+
|
249
|
+
<li class="sub-menu-item"><a class="sub-text" href="#">ううう</a></li>
|
250
|
+
|
251
|
+
<li class="sub-menu-item"><a class="sub-text" href="#">えええ</a></li>
|
252
|
+
|
253
|
+
<li class="sub-menu-item"><a class="sub-text" href="#">おおお</a></li>
|
254
|
+
|
255
|
+
<li class="sub-menu-item"><a class="sub-text" href="#">かかか</a></li>
|
256
|
+
|
257
|
+
</ul>
|
258
|
+
|
259
|
+
</li>
|
260
|
+
|
261
|
+
```
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
上記の「かかか」だけにhoverが適用される状態なのです。
|
266
|
+
|
267
|
+
|
268
|
+
|
49
269
|
|
50
270
|
|
51
271
|
これは一体全体どういうことなのでしょうか?
|