質問編集履歴
5
画像追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,6 +22,14 @@
|
|
22
22
|
|
23
23
|
### 発生している問題・エラーメッセージ
|
24
24
|
|
25
|
+
------pc画面------
|
26
|
+
|
27
|
+
![pc画面](d51ef8bd9cad64024f2ae899848ac140.png)
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
------スマホ画面------
|
32
|
+
|
25
33
|
現在の表示
|
26
34
|
|
27
35
|
![現在の表示](909f96daf6bd973defaf6cb0cbf68c75.png)
|
4
文言修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
### 発生している問題・エラーメッセージ
|
24
24
|
|
25
|
-
|
25
|
+
現在の表示
|
26
26
|
|
27
27
|
![現在の表示](909f96daf6bd973defaf6cb0cbf68c75.png)
|
28
28
|
|
3
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -218,7 +218,7 @@
|
|
218
218
|
|
219
219
|
```
|
220
220
|
|
221
|
-
```css
|
221
|
+
```css
|
222
222
|
|
223
223
|
****css***
|
224
224
|
|
2
コード編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
### 該当のソースコード
|
38
38
|
|
39
|
-
|
39
|
+
```html
|
40
40
|
|
41
41
|
****html****
|
42
42
|
|
@@ -216,7 +216,9 @@
|
|
216
216
|
|
217
217
|
</html>
|
218
218
|
|
219
|
-
|
219
|
+
```
|
220
|
+
|
221
|
+
```csss
|
220
222
|
|
221
223
|
****css***
|
222
224
|
|
@@ -602,6 +604,12 @@
|
|
602
604
|
|
603
605
|
|
604
606
|
|
607
|
+
```
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
605
613
|
### 試したこと
|
606
614
|
|
607
615
|
|
1
スクショ表示 コード書き込み
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,13 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
|
27
|
+
![現在の表示](909f96daf6bd973defaf6cb0cbf68c75.png)
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
下記のようにしたいのです。
|
32
|
+
|
33
|
+
![やりたいこと](9bdff23baf6265df101cca7b4c37a3e5.png)
|
28
34
|
|
29
35
|
|
30
36
|
|
@@ -32,7 +38,567 @@
|
|
32
38
|
|
33
39
|
|
34
40
|
|
41
|
+
****html****
|
42
|
+
|
43
|
+
<!doctype html>
|
44
|
+
|
45
|
+
<html>
|
46
|
+
|
47
|
+
<head>
|
48
|
+
|
49
|
+
<meta charset="utf-8">
|
50
|
+
|
51
|
+
<title>無題ドキュメント</title>
|
52
|
+
|
53
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
54
|
+
|
55
|
+
<link rel="stylesheet" type="text/css" href="style.css">
|
56
|
+
|
57
|
+
</head>
|
58
|
+
|
59
|
+
<body id="contents">
|
60
|
+
|
61
|
+
<header>
|
62
|
+
|
63
|
+
<div class="headerinner">
|
64
|
+
|
65
|
+
<h1>タイトルタイトル</h1>
|
66
|
+
|
67
|
+
<div class="logoarea"> ロゴエリア </div>
|
68
|
+
|
69
|
+
</div>
|
70
|
+
|
71
|
+
</header>
|
72
|
+
|
73
|
+
<div id="wrapper">
|
74
|
+
|
75
|
+
<nav class="menu">
|
76
|
+
|
77
|
+
<ul>
|
78
|
+
|
79
|
+
<li><a href="#">MENU</a></li>
|
80
|
+
|
81
|
+
<li><a href="#">MENU</a></li>
|
82
|
+
|
83
|
+
<li><a href="#">MENU</a></li>
|
84
|
+
|
85
|
+
<li><a href="#">MENU</a></li>
|
86
|
+
|
87
|
+
<li><a href="#">MENU</a></li>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<button type="button" id="nav-btn" class="hamburger"> <span class="bdr"></span> <span class="bdr"></span> <span class="bdr"></span> </button>
|
94
|
+
|
95
|
+
<div>
|
96
|
+
|
97
|
+
<div class="flexbox">
|
98
|
+
|
99
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
100
|
+
|
101
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
102
|
+
|
103
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
104
|
+
|
105
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
106
|
+
|
107
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
108
|
+
|
109
|
+
<div class="item">テキストテキストテキストテキストテキストテキストテキストテキスト</div>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<!-- wrapper -->
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<footer> footer </footer>
|
122
|
+
|
123
|
+
<script type = "text/javascript">
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
(function () {
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
//ハンバーガーボタンクリック時の関数
|
132
|
+
|
133
|
+
//querySelector:CSSセレクタで要素を取得
|
134
|
+
|
135
|
+
const $hamburger = document.querySelector('.hamburger');
|
136
|
+
|
137
|
+
//addEventListener:イベント処理(click)
|
138
|
+
|
139
|
+
$hamburger.addEventListener('click', function(){
|
140
|
+
|
141
|
+
//ON時はis-activeクラス付与、OFF時はis-activeクラス削除
|
142
|
+
|
143
|
+
$hamburger.classList.toggle('is-active')
|
144
|
+
|
35
|
-
|
145
|
+
});
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
//全体を囲む要素をid[#wrapper]で指定
|
150
|
+
|
151
|
+
const $wrapper = document.getElementById('wrapper');
|
152
|
+
|
153
|
+
//メニューオープン・クローズのボタン要素をid[nav-btn]で指定
|
154
|
+
|
155
|
+
const $navBtn = document.getElementById('nav-btn');
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
//クリックしたら navToggle関数実行
|
160
|
+
|
161
|
+
$navBtn.addEventListener('click', navToggle);
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
//navToggleの関数
|
166
|
+
|
167
|
+
function navToggle() {
|
168
|
+
|
169
|
+
//contains:文字列が引数に指定した文字列を含まれているかどうか[nav-open]
|
170
|
+
|
171
|
+
if ($wrapper.classList.contains('nav-open')) {
|
172
|
+
|
173
|
+
//メニュークローズ時
|
174
|
+
|
175
|
+
navCloseFunc();
|
176
|
+
|
177
|
+
} else {
|
178
|
+
|
179
|
+
//メニューオープン時
|
180
|
+
|
181
|
+
navOpenFunc();
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
//メニューオープン時の関数
|
190
|
+
|
191
|
+
function navOpenFunc() {
|
192
|
+
|
193
|
+
//wrapperのclass[nav-open]付与
|
194
|
+
|
195
|
+
$wrapper.classList.add('nav-open');
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
//メニュークローズ時の関数
|
200
|
+
|
201
|
+
function navCloseFunc() {
|
202
|
+
|
203
|
+
//wrapperのclass[nav-open]削除
|
204
|
+
|
205
|
+
$wrapper.classList.remove('nav-open');
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
})();
|
212
|
+
|
213
|
+
</script>
|
214
|
+
|
215
|
+
</body>
|
216
|
+
|
217
|
+
</html>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
****css***
|
222
|
+
|
223
|
+
* {
|
224
|
+
|
225
|
+
margin: 0;
|
226
|
+
|
227
|
+
padding: 0;
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
li {
|
232
|
+
|
233
|
+
list-style: none;
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
a {
|
238
|
+
|
239
|
+
color: #000;
|
240
|
+
|
241
|
+
text-decoration: none;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
h1 {
|
246
|
+
|
247
|
+
font-size: 0.5em;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
#wrapper {
|
252
|
+
|
253
|
+
font-size: 1.2rem;
|
254
|
+
|
255
|
+
width: 100%;
|
256
|
+
|
257
|
+
text-align: center;
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
#contents {
|
262
|
+
|
263
|
+
transform: translateX(0);
|
264
|
+
|
265
|
+
transition: .4s transform;
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
#contents {
|
270
|
+
|
271
|
+
background-color: #fff;
|
272
|
+
|
273
|
+
}
|
274
|
+
|
275
|
+
#nav-btn {
|
276
|
+
|
277
|
+
display: none;
|
278
|
+
|
279
|
+
outline: none;
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
.menu ul {
|
284
|
+
|
285
|
+
display: flex;
|
286
|
+
|
287
|
+
justify-content: center;
|
288
|
+
|
289
|
+
align-items: center;
|
290
|
+
|
291
|
+
background: #5994FF;
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
.menu ul li {
|
296
|
+
|
297
|
+
padding: 0 20px;
|
298
|
+
|
299
|
+
transition: all .5s;
|
300
|
+
|
301
|
+
}
|
302
|
+
|
303
|
+
.menu ul li a {
|
304
|
+
|
305
|
+
position: relative;
|
306
|
+
|
307
|
+
display: inline-block;
|
308
|
+
|
309
|
+
text-decoration: none;
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
.menu ul li a:after {
|
314
|
+
|
315
|
+
position: absolute;
|
316
|
+
|
317
|
+
bottom: -4px;
|
318
|
+
|
319
|
+
left: 0;
|
320
|
+
|
321
|
+
content: '';
|
322
|
+
|
323
|
+
width: 100%;
|
324
|
+
|
325
|
+
height: 2px;
|
326
|
+
|
327
|
+
background: #333;
|
328
|
+
|
329
|
+
transform: scale(0, 1);
|
330
|
+
|
331
|
+
transform-origin: left top;
|
332
|
+
|
333
|
+
transition: transform .3s;
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
.menu ul li a:hover::after {
|
338
|
+
|
339
|
+
transform: scale(1, 1);
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
@media screen and (max-width: 768px) {
|
346
|
+
|
347
|
+
#nav-btn {
|
348
|
+
|
349
|
+
display: block;
|
350
|
+
|
351
|
+
position: fixed;
|
352
|
+
|
353
|
+
z-index: 11;
|
354
|
+
|
355
|
+
top: 10px;
|
356
|
+
|
357
|
+
right: 10px;
|
358
|
+
|
359
|
+
background: transparent;
|
360
|
+
|
361
|
+
border: none;
|
362
|
+
|
363
|
+
}
|
364
|
+
|
365
|
+
.hamburger {
|
366
|
+
|
367
|
+
position: relative;
|
368
|
+
|
369
|
+
display: block;
|
370
|
+
|
371
|
+
width: 50px;
|
372
|
+
|
373
|
+
height: 44px;
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
.hamburger .bdr {
|
378
|
+
|
379
|
+
position: absolute;
|
380
|
+
|
381
|
+
left: 0;
|
382
|
+
|
383
|
+
width: 100%;
|
384
|
+
|
385
|
+
height: 4px;
|
386
|
+
|
387
|
+
border-radius: 4px;
|
388
|
+
|
389
|
+
background: #000;
|
390
|
+
|
391
|
+
transition: all .5s;
|
392
|
+
|
393
|
+
}
|
394
|
+
|
395
|
+
.hamburger .bdr:nth-child(1) {
|
396
|
+
|
397
|
+
top: 0;
|
398
|
+
|
399
|
+
}
|
400
|
+
|
401
|
+
.hamburger .bdr:nth-child(2) {
|
402
|
+
|
403
|
+
top: 20px;
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
.hamburger .bdr:nth-child(3) {
|
408
|
+
|
409
|
+
bottom: 0;
|
410
|
+
|
411
|
+
}
|
412
|
+
|
413
|
+
.hamburger.is-active .bdr {
|
414
|
+
|
415
|
+
background: #000;
|
416
|
+
|
417
|
+
}
|
418
|
+
|
419
|
+
.hamburger.is-active .bdr:nth-child(1) {
|
420
|
+
|
421
|
+
transform: translateY(20px) rotate(-45deg);
|
422
|
+
|
423
|
+
}
|
424
|
+
|
425
|
+
.hamburger.is-active .bdr:nth-child(2) {
|
426
|
+
|
427
|
+
opacity: 0;
|
428
|
+
|
429
|
+
}
|
430
|
+
|
431
|
+
.hamburger.is-active .bdr:nth-child(3) {
|
432
|
+
|
433
|
+
transform: translateY(-20px) rotate(45deg);
|
434
|
+
|
435
|
+
}
|
436
|
+
|
437
|
+
.menu {
|
438
|
+
|
439
|
+
position: fixed;
|
440
|
+
|
441
|
+
top: 0;
|
442
|
+
|
443
|
+
right: 0;
|
444
|
+
|
445
|
+
width: 150px;
|
446
|
+
|
447
|
+
height: 100%;
|
448
|
+
|
449
|
+
padding-top: 70px;
|
450
|
+
|
451
|
+
text-align: left;
|
452
|
+
|
453
|
+
font-size: 13px;
|
454
|
+
|
455
|
+
background: #5994FF;
|
456
|
+
|
457
|
+
z-index: 1;
|
458
|
+
|
459
|
+
transform: translateX(150px);
|
460
|
+
|
461
|
+
transition: .4s all;
|
462
|
+
|
463
|
+
}
|
464
|
+
|
465
|
+
.menu ul {
|
466
|
+
|
467
|
+
display: block;
|
468
|
+
|
469
|
+
width: 150px;
|
470
|
+
|
471
|
+
line-height: 70px;
|
472
|
+
|
473
|
+
background: none;
|
474
|
+
|
475
|
+
color: #000;
|
476
|
+
|
477
|
+
text-align: center;
|
478
|
+
|
479
|
+
}
|
480
|
+
|
481
|
+
.menu ul li {
|
482
|
+
|
483
|
+
transition: all .5s;
|
484
|
+
|
485
|
+
}
|
486
|
+
|
487
|
+
.menu ul li:hover {
|
488
|
+
|
489
|
+
background: #fff;
|
490
|
+
|
491
|
+
}
|
492
|
+
|
493
|
+
.menu ul li a:after {
|
494
|
+
|
495
|
+
display: none;
|
496
|
+
|
497
|
+
}
|
498
|
+
|
499
|
+
.nav-open .menu {
|
500
|
+
|
501
|
+
transform: translateX(0);
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
.nav-open #contents {
|
506
|
+
|
507
|
+
transform: translateX(-150px);
|
508
|
+
|
509
|
+
}
|
510
|
+
|
511
|
+
}
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
@media screen and (min-width: 768px) {
|
516
|
+
|
517
|
+
nav.menu {
|
518
|
+
|
519
|
+
margin-bottom: 1.5em;
|
520
|
+
|
521
|
+
}
|
522
|
+
|
523
|
+
}
|
524
|
+
|
525
|
+
header {
|
526
|
+
|
527
|
+
margin-bottom: 1.5em;
|
528
|
+
|
529
|
+
}
|
530
|
+
|
531
|
+
.flexbox {
|
532
|
+
|
533
|
+
display: flex;
|
534
|
+
|
535
|
+
justify-content: space-between;
|
536
|
+
|
537
|
+
align-items: center;
|
538
|
+
|
539
|
+
flex-wrap: wrap;
|
540
|
+
|
541
|
+
max-width: 980px;
|
542
|
+
|
543
|
+
margin: 0 auto;
|
544
|
+
|
545
|
+
}
|
546
|
+
|
547
|
+
.headerinner {
|
548
|
+
|
549
|
+
max-width: 980px;
|
550
|
+
|
551
|
+
margin: 0 auto;
|
552
|
+
|
553
|
+
text-align: center;
|
554
|
+
|
555
|
+
}
|
556
|
+
|
557
|
+
.item {
|
558
|
+
|
559
|
+
width: 33%;
|
560
|
+
|
561
|
+
height: 200px;
|
562
|
+
|
563
|
+
background: #83C3FF;
|
564
|
+
|
565
|
+
display: block;
|
566
|
+
|
567
|
+
margin-bottom: 10px;
|
568
|
+
|
569
|
+
}
|
570
|
+
|
571
|
+
.logoarea {
|
572
|
+
|
573
|
+
width: 200px;
|
574
|
+
|
575
|
+
height: 66px;
|
576
|
+
|
577
|
+
color: #fff;
|
578
|
+
|
579
|
+
line-height: 66px;
|
580
|
+
|
581
|
+
background: #3D4490;
|
582
|
+
|
583
|
+
margin: 0 auto;
|
584
|
+
|
585
|
+
}
|
586
|
+
|
587
|
+
footer {
|
588
|
+
|
589
|
+
background: #3D4490;
|
590
|
+
|
591
|
+
color: #ffffff;
|
592
|
+
|
593
|
+
text-align: center;
|
594
|
+
|
595
|
+
padding: 1em;
|
596
|
+
|
597
|
+
margin-top: 1.5em;
|
598
|
+
|
599
|
+
}
|
600
|
+
|
601
|
+
|
36
602
|
|
37
603
|
|
38
604
|
|
@@ -40,9 +606,7 @@
|
|
40
606
|
|
41
607
|
|
42
608
|
|
43
|
-
参考サイト(https://www.evoworx.co.jp/blog/drawer/)をみて実装するも、上にロゴがあるパターンではないので、
|
44
|
-
|
45
|
-
|
609
|
+
bodyタグに、contentsのクラス名を移動しました。
|
46
610
|
|
47
611
|
|
48
612
|
|