teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

ソース不要と思われる部分を削除しました

2018/04/21 07:42

投稿

us5
us5

スコア6

title CHANGED
File without changes
body CHANGED
@@ -26,12 +26,6 @@
26
26
  margin: 0;
27
27
  }
28
28
 
29
- body {
30
- color: #000;
31
- font: 15px/1.7 "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "メイリオ", Meiryo, "MS Pゴシック", sans-serif;
32
- background-color: #f5f5f5;
33
- text-align: left;
34
- }
35
29
 
36
30
  ol, ul {
37
31
  list-style: none;
@@ -45,6 +39,8 @@
45
39
  /**
46
40
  * base
47
41
  */
42
+
43
+
48
44
  .wrapper {
49
45
  width: 100%;
50
46
  height: 100vh;
@@ -53,64 +49,15 @@
53
49
  background: #BED6E6;
54
50
  }
55
51
 
52
+
56
53
  .contents {
57
54
  width: 100%;
58
55
  height: 100%;
59
56
  }
60
57
 
61
- .contents__inner {
62
- box-sizing: border-box;
63
- width: 100%;
64
- margin: 0 auto;
65
- padding: 50px 24px;
66
- color: #fff;
67
- }
68
58
 
69
- .contents__inner h1 {
70
- margin-bottom: 30px;
71
- font-size: 20px;
72
- font-weight: bold;
73
- }
74
59
 
75
-
76
60
  /**
77
- * btn
78
- */
79
- .btn__box {
80
- width: 250px;
81
- height: 50px;
82
- line-height: 50px;
83
- margin: 100px auto 0;
84
- font-size: 13px;
85
- }
86
-
87
- .btn__box a {
88
- position: relative;
89
- display: block;
90
- color: #666;
91
- background: #fff;
92
- }
93
-
94
- .btn__box a:before {
95
- content: '';
96
- position: absolute;
97
- top: -5px;
98
- left: -5px;
99
- box-sizing: border-box;
100
- width: 250px;
101
- height: 50px;
102
- border: 1px solid #666;
103
- -webkit-transition: all .5s ease;
104
- transition: all .5s ease;
105
- }
106
-
107
- .btn__box a:hover:before {
108
- -webkit-transform: translate(10px, 10px);
109
- transform: translate(10px, 10px);
110
- }
111
-
112
-
113
- /**
114
61
  * menu
115
62
  */
116
63
  .menu {
@@ -138,47 +85,14 @@
138
85
  color: #999;
139
86
  }
140
87
 
141
- .menu__none:hover,
88
+
142
- .menu__multi:hover,
143
89
  .menu__mega:hover,
144
- .menu__single:hover {
145
90
  background: #072A24;
146
91
  -webkit-transition: .2s ease;
147
92
  transition: .2s ease;
148
93
  }
149
94
 
150
- .menu__second-level li {
151
- border-top: 1px solid #111;
152
- }
153
95
 
154
- .menu__third-level li {
155
- border-top: 1px solid #111;
156
- }
157
-
158
- .menu__second-level li a:hover {
159
- background: #111;
160
- }
161
-
162
- .menu__third-level li a:hover {
163
- background: #2a1f1f;
164
- }
165
-
166
- .menu__fourth-level li a:hover {
167
- background: #1d0f0f;
168
- }
169
-
170
- .init-bottom:after {
171
- content: '';
172
- display: inline-block;
173
- width: 6px;
174
- height: 6px;
175
- margin: 0 0 0 15px;
176
- border-right: 1px solid #fff;
177
- border-bottom: 1px solid #fff;
178
- -webkit-transform: rotate(45deg);
179
- transform: rotate(45deg);
180
- }
181
-
182
96
  .menu:before,
183
97
  .menu:after {
184
98
  content: "";
@@ -194,120 +108,8 @@
194
108
  }
195
109
 
196
110
 
197
- /**
198
- * single menu
199
- */
200
- .menu > .menu__single {
201
- position: relative;
202
- }
203
111
 
204
- .menu__single .menu__second-level {
205
- position: absolute;
206
- top: 40px;
207
- width: 100%;
208
- background: #072A24;
209
- -webkit-transition: .2s ease;
210
- transition: .2s ease;
211
- visibility: hidden;
212
- opacity: 0;
213
- }
214
-
215
- .menu__single:hover > .menu__second-level {
216
- top: 50px;
217
- visibility: visible;
218
- opacity: 1;
219
- }
220
-
221
-
222
112
  /**
223
- * multi menu
224
- */
225
- .menu > .menu__multi {
226
- position: relative;
227
- }
228
-
229
- .menu__multi .menu__second-level {
230
- position: absolute;
231
- top: 40px;
232
- width: 100%;
233
- background: #072A24;
234
- -webkit-transition: all .2s ease;
235
- transition: all .2s ease;
236
- visibility: hidden;
237
- opacity: 0;
238
- z-index: 1;
239
- }
240
-
241
- .menu__multi:hover .menu__second-level {
242
- top: 50px;
243
- visibility: visible;
244
- opacity: 1;
245
- }
246
-
247
- .menu__multi .menu__second-level li {
248
- position: relative;
249
- }
250
-
251
- .menu__multi .menu__second-level li:hover {
252
- background: #111;
253
- }
254
-
255
- .menu__multi .menu__second-level li .menu__third-level {
256
- position: absolute;
257
- top: -1px;
258
- left: 100%;
259
- width: 100%;
260
- background: #111;
261
- -webkit-transition: all .2s ease;
262
- transition: all .2s ease;
263
- visibility: hidden;
264
- opacity: 0;
265
- }
266
-
267
- .menu__multi .menu__second-level li:hover .menu__third-level {
268
- visibility: visible;
269
- opacity: 1;
270
- }
271
-
272
- .menu__multi .menu__second-level li .menu__third-level li {
273
- position: relative;
274
- }
275
-
276
- .menu__multi .menu__second-level li .menu__third-level li:hover {
277
- background: #2a1f1f;
278
- }
279
-
280
- .menu__multi .menu__second-level li .menu__third-level li .menu__fourth-level {
281
- position: absolute;
282
- top: -1px;
283
- left: 100%;
284
- width: 100%;
285
- background: #2a1f1f;
286
- -webkit-transition: all .2s ease;
287
- transition: all .2s ease;
288
- visibility: hidden;
289
- opacity: 0;
290
- }
291
-
292
- .menu__multi .menu__second-level li .menu__third-level li:hover .menu__fourth-level {
293
- visibility: visible;
294
- opacity: 1;
295
- }
296
-
297
- .init-right:after {
298
- content: '';
299
- display: inline-block;
300
- width: 6px;
301
- height: 6px;
302
- margin: 0 0 0 15px;
303
- border-right: 1px solid #fff;
304
- border-top: 1px solid #fff;
305
- -webkit-transform: rotate(45deg);
306
- transform: rotate(45deg);
307
- }
308
-
309
-
310
- /**
311
113
  * mega menu
312
114
  */
313
115
  .menu__mega .menu__second-level {
@@ -340,6 +142,7 @@
340
142
  .menu__mega .menu__second-level > li:nth-child(3n+2) {
341
143
  margin: 0 1%;
342
144
  }
145
+
343
146
  </style>
344
147
 
345
148
 

1

ソースを記載

2018/04/21 07:42

投稿

us5
us5

スコア6

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,356 @@
1
+ <style>
2
+ @charset "UTF-8";
3
+
4
+ /**
5
+ * reset
6
+ */
7
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp,
9
+ small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,
10
+ fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,
11
+ article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup,
12
+ menu, nav, output, ruby, section, summary, time, mark, audio, video, main {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0;
16
+ outline: 0;
17
+ font-size: 100%;
18
+ font-weight: normal;
19
+ font-style: normal;
20
+ vertical-align: baseline;
21
+ background: transparent;
22
+ }
23
+
24
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, main {
25
+ display: block;
26
+ margin: 0;
27
+ }
28
+
29
+ body {
30
+ color: #000;
31
+ font: 15px/1.7 "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "メイリオ", Meiryo, "MS Pゴシック", sans-serif;
32
+ background-color: #f5f5f5;
33
+ text-align: left;
34
+ }
35
+
36
+ ol, ul {
37
+ list-style: none;
38
+ }
39
+
40
+ a {
41
+ text-decoration: none;
42
+ }
43
+
44
+
45
+ /**
46
+ * base
47
+ */
48
+ .wrapper {
49
+ width: 100%;
50
+ height: 100vh;
51
+ text-align: center;
52
+ font-size: 13px;
53
+ background: #BED6E6;
54
+ }
55
+
56
+ .contents {
57
+ width: 100%;
58
+ height: 100%;
59
+ }
60
+
61
+ .contents__inner {
62
+ box-sizing: border-box;
63
+ width: 100%;
64
+ margin: 0 auto;
65
+ padding: 50px 24px;
66
+ color: #fff;
67
+ }
68
+
69
+ .contents__inner h1 {
70
+ margin-bottom: 30px;
71
+ font-size: 20px;
72
+ font-weight: bold;
73
+ }
74
+
75
+
76
+ /**
77
+ * btn
78
+ */
79
+ .btn__box {
80
+ width: 250px;
81
+ height: 50px;
82
+ line-height: 50px;
83
+ margin: 100px auto 0;
84
+ font-size: 13px;
85
+ }
86
+
87
+ .btn__box a {
88
+ position: relative;
89
+ display: block;
90
+ color: #666;
91
+ background: #fff;
92
+ }
93
+
94
+ .btn__box a:before {
95
+ content: '';
96
+ position: absolute;
97
+ top: -5px;
98
+ left: -5px;
99
+ box-sizing: border-box;
100
+ width: 250px;
101
+ height: 50px;
102
+ border: 1px solid #666;
103
+ -webkit-transition: all .5s ease;
104
+ transition: all .5s ease;
105
+ }
106
+
107
+ .btn__box a:hover:before {
108
+ -webkit-transform: translate(10px, 10px);
109
+ transform: translate(10px, 10px);
110
+ }
111
+
112
+
113
+ /**
114
+ * menu
115
+ */
116
+ .menu {
117
+ position: relative;
118
+ width: 100%;
119
+ height: 50px;
120
+ max-width: 1000px;
121
+ margin: 0 auto;
122
+ }
123
+
124
+ .menu > li {
125
+ float: left;
126
+ width: 25%;
127
+ height: 50px;
128
+ line-height: 50px;
129
+ background: rgb(29, 33, 19);
130
+ }
131
+
132
+ .menu > li a {
133
+ display: block;
134
+ color: #fff;
135
+ }
136
+
137
+ .menu > li a:hover {
138
+ color: #999;
139
+ }
140
+
141
+ .menu__none:hover,
142
+ .menu__multi:hover,
143
+ .menu__mega:hover,
144
+ .menu__single:hover {
145
+ background: #072A24;
146
+ -webkit-transition: .2s ease;
147
+ transition: .2s ease;
148
+ }
149
+
150
+ .menu__second-level li {
151
+ border-top: 1px solid #111;
152
+ }
153
+
154
+ .menu__third-level li {
155
+ border-top: 1px solid #111;
156
+ }
157
+
158
+ .menu__second-level li a:hover {
159
+ background: #111;
160
+ }
161
+
162
+ .menu__third-level li a:hover {
163
+ background: #2a1f1f;
164
+ }
165
+
166
+ .menu__fourth-level li a:hover {
167
+ background: #1d0f0f;
168
+ }
169
+
170
+ .init-bottom:after {
171
+ content: '';
172
+ display: inline-block;
173
+ width: 6px;
174
+ height: 6px;
175
+ margin: 0 0 0 15px;
176
+ border-right: 1px solid #fff;
177
+ border-bottom: 1px solid #fff;
178
+ -webkit-transform: rotate(45deg);
179
+ transform: rotate(45deg);
180
+ }
181
+
182
+ .menu:before,
183
+ .menu:after {
184
+ content: "";
185
+ display: table;
186
+ }
187
+
188
+ .menu:after {
189
+ clear: both;
190
+ }
191
+
192
+ .menu {
193
+ *zoom: 1;
194
+ }
195
+
196
+
197
+ /**
198
+ * single menu
199
+ */
200
+ .menu > .menu__single {
201
+ position: relative;
202
+ }
203
+
204
+ .menu__single .menu__second-level {
205
+ position: absolute;
206
+ top: 40px;
207
+ width: 100%;
208
+ background: #072A24;
209
+ -webkit-transition: .2s ease;
210
+ transition: .2s ease;
211
+ visibility: hidden;
212
+ opacity: 0;
213
+ }
214
+
215
+ .menu__single:hover > .menu__second-level {
216
+ top: 50px;
217
+ visibility: visible;
218
+ opacity: 1;
219
+ }
220
+
221
+
222
+ /**
223
+ * multi menu
224
+ */
225
+ .menu > .menu__multi {
226
+ position: relative;
227
+ }
228
+
229
+ .menu__multi .menu__second-level {
230
+ position: absolute;
231
+ top: 40px;
232
+ width: 100%;
233
+ background: #072A24;
234
+ -webkit-transition: all .2s ease;
235
+ transition: all .2s ease;
236
+ visibility: hidden;
237
+ opacity: 0;
238
+ z-index: 1;
239
+ }
240
+
241
+ .menu__multi:hover .menu__second-level {
242
+ top: 50px;
243
+ visibility: visible;
244
+ opacity: 1;
245
+ }
246
+
247
+ .menu__multi .menu__second-level li {
248
+ position: relative;
249
+ }
250
+
251
+ .menu__multi .menu__second-level li:hover {
252
+ background: #111;
253
+ }
254
+
255
+ .menu__multi .menu__second-level li .menu__third-level {
256
+ position: absolute;
257
+ top: -1px;
258
+ left: 100%;
259
+ width: 100%;
260
+ background: #111;
261
+ -webkit-transition: all .2s ease;
262
+ transition: all .2s ease;
263
+ visibility: hidden;
264
+ opacity: 0;
265
+ }
266
+
267
+ .menu__multi .menu__second-level li:hover .menu__third-level {
268
+ visibility: visible;
269
+ opacity: 1;
270
+ }
271
+
272
+ .menu__multi .menu__second-level li .menu__third-level li {
273
+ position: relative;
274
+ }
275
+
276
+ .menu__multi .menu__second-level li .menu__third-level li:hover {
277
+ background: #2a1f1f;
278
+ }
279
+
280
+ .menu__multi .menu__second-level li .menu__third-level li .menu__fourth-level {
281
+ position: absolute;
282
+ top: -1px;
283
+ left: 100%;
284
+ width: 100%;
285
+ background: #2a1f1f;
286
+ -webkit-transition: all .2s ease;
287
+ transition: all .2s ease;
288
+ visibility: hidden;
289
+ opacity: 0;
290
+ }
291
+
292
+ .menu__multi .menu__second-level li .menu__third-level li:hover .menu__fourth-level {
293
+ visibility: visible;
294
+ opacity: 1;
295
+ }
296
+
297
+ .init-right:after {
298
+ content: '';
299
+ display: inline-block;
300
+ width: 6px;
301
+ height: 6px;
302
+ margin: 0 0 0 15px;
303
+ border-right: 1px solid #fff;
304
+ border-top: 1px solid #fff;
305
+ -webkit-transform: rotate(45deg);
306
+ transform: rotate(45deg);
307
+ }
308
+
309
+
310
+ /**
311
+ * mega menu
312
+ */
313
+ .menu__mega .menu__second-level {
314
+ position: absolute;
315
+ top: 40px;
316
+ left: 0;
317
+ box-sizing: border-box;
318
+ width: 100%;
319
+ padding: 20px 2%;
320
+ background: #072A24;
321
+ -webkit-transition: all .2s ease;
322
+ transition: all .2s ease;
323
+ visibility: hidden;
324
+ opacity: 0;
325
+ z-index: 1;
326
+ }
327
+
328
+ .menu__mega:hover .menu__second-level {
329
+ top: 50px;
330
+ visibility: visible;
331
+ opacity: 1;
332
+ }
333
+
334
+ .menu__mega .menu__second-level > li {
335
+ float: left;
336
+ width: 32%;
337
+ border: none;
338
+ }
339
+
340
+ .menu__mega .menu__second-level > li:nth-child(3n+2) {
341
+ margin: 0 1%;
342
+ }
343
+ </style>
344
+
345
+
346
+
347
+
1
348
  アイフォンでのif内のメニューの正常な動作
2
349
 
350
+ すみません修正させていただきました
351
+
3
- https://theorthodoxworks.com/demo/201502/demo-drop-down-menu-multi-css.html
352
+ [https://theorthodoxworks.com/demo/201502/demo-drop-down-menu-multi-css.html](https://theorthodoxworks.com/demo/201502/demo-drop-down-menu-multi-css.html)
4
- こちらのサイトのドロップダウンメニューを使用させていただこうと思ってるのですが
353
+ こちらのサイトのドロップダウンメニューをインラインフレーム内で使用させていただこうと思ってるのですが
5
- インラインフレームでスマートフォンのアイフォンでPC表示にした場合動作しないのですが
354
+ PCは正常に動作するのですがスマートフォンのアイフォンでPC表示にした場合動作しないのですが
6
355
  どのようにしたらよいのか教えていただきたいのですが宜しくお願い致します。
7
356
  (アンドロイドでは動作しました)