質問編集履歴

1

まず、CSSのみ

2021/02/17 15:45

投稿

B_J
B_J

スコア15

test CHANGED
File without changes
test CHANGED
@@ -4,432 +4,772 @@
4
4
 
5
5
 
6
6
 
7
+ ```css
8
+
9
+ body{
10
+
11
+ background-color: #d2d2d2;
12
+
13
+ }
14
+
15
+
16
+
17
+ .container{
18
+
19
+ width: 1200px;
20
+
21
+ background-color: white;
22
+
23
+ margin: 0 auto;
24
+
25
+ }
26
+
27
+
28
+
29
+ .h-title{
30
+
31
+ height: 100px;
32
+
33
+ border-top: 5px solid blue;
34
+
35
+ position: relative;
36
+
37
+
38
+
39
+ }
40
+
41
+ .h-title .h-logo{
42
+
43
+ width: 300px;
44
+
45
+ position: absolute;
46
+
47
+ top: 50%;
48
+
49
+ left: 4%;
50
+
51
+ transform: translateY(-50%);
52
+
53
+ }
54
+
55
+ .h-nav{
56
+
57
+ border-top: 1px solid #d2d2d2;
58
+
59
+ }
60
+
61
+ .h-menu{
62
+
63
+ letter-spacing: -.4em;
64
+
65
+ }
66
+
67
+
68
+
69
+ .h-list{
70
+
71
+ display: inline-block;
72
+
73
+ width: calc(100%/6);
74
+
75
+ position: relative;
76
+
77
+ letter-spacing: normal;
78
+
79
+ height: 64px;
80
+
81
+ border-right: 1px solid #d2d2d2;
82
+
83
+ box-sizing: border-box;
84
+
85
+ vertical-align: bottom;
86
+
87
+ }
88
+
89
+
90
+
91
+
92
+
93
+ .h-list:hover .h-l-top{
94
+
95
+ color: #0e36ca;
96
+
97
+ }
98
+
99
+ .h-list:hover{
100
+
101
+ background-color: #e6ebfa;
102
+
103
+ }
104
+
105
+
106
+
107
+ .h-list:hover .h-l-box:before{
108
+
109
+ content: "";
110
+
111
+ width: 3px;
112
+
113
+ height: 100%;
114
+
115
+ position: absolute;
116
+
117
+ background-color: #0e36ca;
118
+
119
+ left:4px
120
+
121
+
122
+
123
+ }
124
+
125
+
126
+
127
+ .h-l-box{
128
+
129
+ position: absolute;
130
+
131
+ top: 50%;
132
+
133
+ left: 50%;
134
+
135
+ transform: translate(-50%, -50%);
136
+
137
+ width: 90%;
138
+
139
+ text-align: center;
140
+
141
+ }
142
+
143
+
144
+
145
+ .h-l-top{
146
+
147
+ font-size: 15px;
148
+
149
+ font-weight: bold;
150
+
151
+ color: #666666;
152
+
153
+ margin-bottom: 4px;
154
+
155
+ }
156
+
157
+
158
+
159
+ .h-l-bottom{
160
+
161
+ font-size: 10px;
162
+
163
+ color: #bababa;
164
+
165
+ text-align: center;
166
+
167
+
168
+
169
+ }
170
+
171
+
172
+
173
+ .active{
174
+
175
+ background-color: #e6ebfa;
176
+
177
+ }
178
+
179
+ .active .h-l-box:before{
180
+
181
+ content: "";
182
+
183
+ width: 3px;
184
+
185
+ height: 100%;
186
+
187
+ position: absolute;
188
+
189
+ background-color: #0e36ca;
190
+
191
+ left:4px
192
+
193
+ }
194
+
195
+ .active .h-l-top{
196
+
197
+ color: #0e36ca;
198
+
199
+ }
200
+
201
+
202
+
203
+ .h-image{
204
+
205
+ max-width: 100%;
206
+
207
+ height: auto;
208
+
209
+ }
210
+
211
+
212
+
213
+ .contents{
214
+
215
+ padding: 24px;
216
+
217
+ }
218
+
219
+
220
+
221
+ .main{
222
+
223
+ float: left;
224
+
225
+ width: 70%;
226
+
227
+
228
+
229
+ }
230
+
231
+
232
+
233
+ .m-h2{
234
+
235
+ background-color: #0f3bda;
236
+
237
+ color: white;
238
+
239
+ padding: 14px 12px 14px 24px;
240
+
241
+ border-radius: 4px;
242
+
243
+ font-size: 18px;
244
+
245
+ margin-bottom: 24px;
246
+
247
+ }
248
+
249
+
250
+
251
+ .m-h2::first-letter{
252
+
253
+ border-left: 3px solid #8e9eef;
254
+
255
+ padding-left: 16px;
256
+
257
+ }
258
+
259
+
260
+
261
+ .m-info{
262
+
263
+ margin-left: 12px;
264
+
265
+ margin-right: 12px;
266
+
267
+ font-size: 15px;
268
+
269
+
270
+
271
+ }
272
+
273
+
274
+
275
+ .m-section{
276
+
277
+ color: #666666;
278
+
279
+ margin-bottom: 24px;
280
+
281
+
282
+
283
+ }
284
+
285
+
286
+
287
+ .m-log{
288
+
289
+ text-align: right;
290
+
291
+ padding-top: 24px;
292
+
293
+ }
294
+
295
+
296
+
297
+ .m-log a{
298
+
299
+ color: #666666;
300
+
301
+ }
302
+
303
+
304
+
305
+ .m-info-date{
306
+
307
+ float: left;
308
+
309
+ padding: 8px 32px 8px 0px;
310
+
311
+ color: blue;
312
+
313
+
314
+
315
+ }
316
+
317
+
318
+
319
+ .m-info-content{
320
+
321
+ padding: 8px;
322
+
323
+ border-bottom: 1px solid #ccc;
324
+
325
+ }
326
+
327
+
328
+
329
+ .m-info-new{
330
+
331
+ background-color: red;
332
+
333
+ font-size: 11px;
334
+
335
+ color: #fff;
336
+
337
+ padding: 2px 4px;
338
+
339
+ border-radius: 3px;
340
+
341
+
342
+
343
+ }
344
+
345
+
346
+
347
+ .m-h3{
348
+
349
+ background-color: #F6F6F6;
350
+
351
+ color: #666666;
352
+
353
+ padding: 14px 12px 14px 24px;
354
+
355
+ border-radius: 4px;
356
+
357
+ font-size: 17px;
358
+
359
+ margin-bottom: 24px;
360
+
361
+ border: #ccc 1px solid;
362
+
363
+ }
364
+
365
+ .m-point {
366
+
367
+ color: red;/*文字色*/
368
+
369
+
370
+
371
+ }
372
+
373
+ .m-p{
374
+
375
+ color: #666666;
376
+
377
+ font-size: 15px;
378
+
379
+ margin: 24px 16px;
380
+
381
+ line-height: 2;
382
+
383
+
384
+
385
+ }
386
+
387
+
388
+
389
+
390
+
391
+ .side{
392
+
393
+ float: right;
394
+
395
+ width: 25%;
396
+
397
+ }
398
+
399
+
400
+
401
+ .s-framebox{
402
+
403
+ padding: 10px;
404
+
405
+ border: 1px solid #ccc;
406
+
407
+ background-color: #f4f4f4;
408
+
409
+ margin-bottom: 24px;
410
+
411
+ color: #666666;
412
+
413
+ }
414
+
415
+
416
+
417
+ .s-h4{
418
+
419
+ padding: 28px 10px;
420
+
421
+ border-top: 5px solid blue;
422
+
423
+ background: #eeeeee;
424
+
425
+ color: #666666;
426
+
427
+ font-weight: bold;
428
+
429
+
430
+
431
+ }
432
+
433
+ .s-list{
434
+
435
+ border-bottom: 1px solid #d2d2d2;
436
+
437
+ display: flow-root;
438
+
439
+ }
440
+
441
+
442
+
443
+ .s-list :hover{
444
+
445
+ background-color: white;
446
+
447
+ }
448
+
449
+
450
+
451
+ .s-list a{
452
+
453
+ text-decoration: none;
454
+
455
+ display: block;
456
+
457
+ padding: 15px;
458
+
459
+ display: flow-root;
460
+
461
+
462
+
463
+ }
464
+
465
+
466
+
467
+ .s-list :hover a{
468
+
469
+ color: blue;
470
+
471
+ }
472
+
473
+
474
+
475
+ .s-logo{
476
+
477
+ width: 20%;
478
+
479
+ height: auto;
480
+
481
+ float: left;
482
+
483
+ margin-right: 5px;
484
+
485
+ }
486
+
487
+
488
+
489
+ .s-l-title{
490
+
491
+ font-size: 12px;
492
+
493
+ color: blue;
494
+
495
+ }
496
+
497
+
498
+
499
+ .s-l-descryption{
500
+
501
+ font-size: 12px;
502
+
503
+ }
504
+
505
+
506
+
507
+
508
+
509
+ .s-c-title{
510
+
511
+ font-weight: bold;
512
+
513
+ text-align: center;
514
+
515
+ line-height: 1.5;
516
+
517
+
518
+
519
+ }
520
+
521
+ .s-c-info{
522
+
523
+ font-size: 12px;
524
+
525
+ text-align: center;
526
+
527
+ }
528
+
529
+
530
+
531
+ .s-framebox2{
532
+
533
+ padding: 10px;
534
+
535
+ color: #666666;
536
+
537
+ }
538
+
539
+
540
+
541
+ .footer{
542
+
543
+ clear: both;
544
+
545
+ background-color: blue;
546
+
547
+ }
548
+
549
+ .box9 {
550
+
551
+ padding: 1em 1em;
552
+
553
+ margin: 0.1em 0;
554
+
555
+ text-align: center;
556
+
557
+ font-size: 12px;
558
+
559
+ line-height: 2;
560
+
561
+ color: white;
562
+
563
+
564
+
565
+ }
566
+
567
+ .box9 a {
568
+
569
+ text-decoration: none;
570
+
571
+ color: white;
572
+
573
+ }
574
+
575
+
576
+
577
+ .footer a:hover{
578
+
579
+ color: blue;
580
+
581
+ -webkit-transition: 0.3s ease-in-out;
582
+
583
+ -moz-transition: 0.3s ease-in-out;
584
+
585
+ -o-transition: 0.3s ease-in-out;
586
+
587
+ transition: 0.3s ease-in-out;
588
+
589
+ }
590
+
591
+
592
+
593
+
594
+
595
+ #nav-open span, #nav-open span:before, #nav-open span:after{
596
+
597
+ position: absolute;
598
+
599
+ height: 3px;
600
+
601
+ width: 30px;
602
+
603
+ background-color: #666;
604
+
605
+ content: "";
606
+
607
+ cursor: pointer;
608
+
609
+ }
610
+
611
+ #nav-open span{
612
+
613
+ top: 38px;
614
+
615
+ right: 30px;
616
+
617
+ }
618
+
619
+
620
+
621
+ #nav-open span:before{
622
+
623
+ bottom: -12px;
624
+
625
+ }
626
+
627
+
628
+
629
+ #nav-open span:after{
630
+
631
+ bottom: -24px;
632
+
633
+ }
634
+
635
+ #nav-contents{
636
+
637
+ display: none;
638
+
639
+ position: absolute;
640
+
641
+ top: 100px;
642
+
643
+ z-index: 100;
644
+
645
+ width: 100%;
646
+
647
+ height: auto;
648
+
649
+ background: black;
650
+
651
+ transition: .3s;
652
+
653
+ opacity: 0;
654
+
655
+ }
656
+
657
+ #nav-input:checked ~ #nav-contents{
658
+
659
+ opacity: .8;
660
+
661
+ }
662
+
663
+
664
+
665
+ .nav-invisible{
666
+
667
+ display: none;
668
+
669
+ }
670
+
671
+
672
+
673
+ @media screen and (max-width: 780px){
674
+
675
+ body{
676
+
677
+ font-size: 12px;
678
+
679
+ line-height: 1.5;
680
+
681
+ }
682
+
683
+ .main{
684
+
685
+ float: none;
686
+
687
+ width: auto;
688
+
689
+ }
690
+
691
+ .side{
692
+
693
+ float: none;
694
+
695
+ width: auto;
696
+
697
+ }
698
+
699
+ .container{
700
+
701
+ width: 98%;
702
+
703
+ }
704
+
705
+ .contents{
706
+
707
+ padding: 2%;
708
+
709
+ }
710
+
711
+ .h-title .h-logo{
712
+
713
+ width: 60%;
714
+
715
+ }
716
+
717
+ .m-h2, m-h3{
718
+
719
+ font-size: 16px;
720
+
721
+ padding: 7px 6px 7px 8px;
722
+
723
+
724
+
725
+ }
726
+
727
+ .m-h2::first-letter{
728
+
729
+ padding-left: 8px;
730
+
731
+ }
732
+
733
+ .m-info-date{
734
+
735
+ font-size: 8px;
736
+
737
+ }
738
+
739
+ .m-info-content{
740
+
741
+ font-size: 8px;
742
+
743
+ line-height: 1.5;
744
+
745
+ }
746
+
747
+ .m-info-new{
748
+
749
+ font-size: 8px;
750
+
751
+ padding: 1px 2px;
752
+
753
+ }
754
+
755
+ .m-log a{
756
+
757
+ font-size: 12px;
758
+
759
+ }
760
+
761
+ .h-nav{
762
+
763
+ display: none;
764
+
765
+ }
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+ }
774
+
7
775
  ```
8
-
9
-
10
-
11
- <body>
12
-
13
- <div class="container">
14
-
15
- <header class="header">
16
-
17
- <div class="h-title">
18
-
19
- <img class="h-logo" src="images/logo.png" alt="logo">
20
-
21
- <div class="sp-menu">
22
-
23
- <input type="checkbox" id="nav-input" class="nav-invisible">
24
-
25
- <label id="nav-open" for="nav-input"><span></span></label>
26
-
27
- <div id="nav-contents">
28
-
29
- <nav>
30
-
31
- <ul>
32
-
33
- <li class="sp-menu-list">
34
-
35
- <a href="#">
36
-
37
- <div class="sp-menu-top">
38
-
39
- ホーム
40
-
41
- </div>
42
-
43
- <div class="sp-menu-bottom">
44
-
45
- HOME
46
-
47
- </div>
48
-
49
- </a>
50
-
51
- </li>
52
-
53
- </ul>
54
-
55
- </nav>
56
-
57
- </div>
58
-
59
- </div>
60
-
61
- </div>
62
-
63
-
64
-
65
- <nav class="h-nav">
66
-
67
- <ul class="h-menu">
68
-
69
- <li class="h-list active">
70
-
71
- <a href="#">
72
-
73
- <div class="h-l-box">
74
-
75
-
76
-
77
- <div class="h-l-top">
78
-
79
- ホーム
80
-
81
- </div>
82
-
83
- <div class="h-l-bottom">
84
-
85
- HOME
86
-
87
- </div>
88
-
89
- </div>
90
-
91
- </a>
92
-
93
-
94
-
95
- </li>
96
-
97
- <li class="h-list">
98
-
99
- <a href="#">
100
-
101
- <div class="h-l-box">
102
-
103
-
104
-
105
- <div class="h-l-top">
106
-
107
- 会社概要
108
-
109
- </div>
110
-
111
- <div class="h-l-bottom">
112
-
113
- COMPANY
114
-
115
- </div>
116
-
117
- </div>
118
-
119
- </a>
120
-
121
-
122
-
123
- </li>
124
-
125
- <li class="h-list">
126
-
127
- <a href="#">
128
-
129
- <div class="h-l-box">
130
-
131
-
132
-
133
- <div class="h-l-top">
134
-
135
- サービス
136
-
137
- </div>
138
-
139
- <div class="h-l-bottom">
140
-
141
- SERVICE
142
-
143
- </div>
144
-
145
- </div>
146
-
147
- </a>
148
-
149
-
150
-
151
- </li>
152
-
153
- <li class="h-list">
154
-
155
- <a href="#">
156
-
157
- <div class="h-l-box">
158
-
159
-
160
-
161
- <div class="h-l-top">
162
-
163
- 採用情報
164
-
165
- </div>
166
-
167
- <div class="h-l-bottom">
168
-
169
- RECRUIT
170
-
171
- </div>
172
-
173
- </div>
174
-
175
- </a>
176
-
177
- </li>
178
-
179
- <li class="h-list">
180
-
181
- <a href="#">
182
-
183
- <div class="h-l-box">
184
-
185
-
186
-
187
- <div class="h-l-top">
188
-
189
- リンク
190
-
191
- </div>
192
-
193
- <div class="h-l-bottom">
194
-
195
- LINK
196
-
197
- </div>
198
-
199
- </div>
200
-
201
- </a>
202
-
203
- </li>
204
-
205
- <li class="h-list">
206
-
207
- <a href="#">
208
-
209
- <div class="h-l-box">
210
-
211
-
212
-
213
- <div class="h-l-top">
214
-
215
- お問い合わせ
216
-
217
- </div>
218
-
219
- <div class="h-l-bottom">
220
-
221
- CONTACT
222
-
223
- </div>
224
-
225
- </div>
226
-
227
- </a>
228
-
229
- </li>
230
-
231
- </ul>
232
-
233
- </nav>
234
-
235
- <div class="h-imagebox">
236
-
237
- <img class="h-image" src="images/main.jpg" alt="ヘッダーの画像">
238
-
239
-
240
-
241
- </div>
242
-
243
- </header>
244
-
245
-
246
-
247
-
248
-
249
- ```CSS
250
-
251
-
252
-
253
-
254
-
255
- #nav-open span, #nav-open span:before, #nav-open span:after{
256
-
257
- position: absolute;
258
-
259
- height: 3px;
260
-
261
- width: 30px;
262
-
263
- background-color: #666;
264
-
265
- content: "";
266
-
267
- cursor: pointer;
268
-
269
- }
270
-
271
- #nav-open span{
272
-
273
- top: 38px;
274
-
275
- right: 30px;
276
-
277
- }
278
-
279
-
280
-
281
- #nav-open span:before{
282
-
283
- bottom: -12px;
284
-
285
- }
286
-
287
-
288
-
289
- #nav-open span:after{
290
-
291
- bottom: -24px;
292
-
293
- }
294
-
295
- #nav-contents{
296
-
297
- display: none;
298
-
299
- position: absolute;
300
-
301
- top: 100px;
302
-
303
- z-index: 100;
304
-
305
- width: 100%;
306
-
307
- height: auto;
308
-
309
- background: black;
310
-
311
- transition: .3s;
312
-
313
- opacity: 0;
314
-
315
- }
316
-
317
- #nav-input:checked ~ #nav-contents{
318
-
319
- opacity: .8;
320
-
321
- }
322
-
323
-
324
-
325
- .nav-invisible{
326
-
327
- display: none;
328
-
329
- }
330
-
331
-
332
-
333
- @media screen and (max-width: 780px){
334
-
335
- body{
336
-
337
- font-size: 12px;
338
-
339
- line-height: 1.5;
340
-
341
- }
342
-
343
- .main{
344
-
345
- float: none;
346
-
347
- width: auto;
348
-
349
- }
350
-
351
- .side{
352
-
353
- float: none;
354
-
355
- width: auto;
356
-
357
- }
358
-
359
- .container{
360
-
361
- width: 98%;
362
-
363
- }
364
-
365
- .contents{
366
-
367
- padding: 2%;
368
-
369
- }
370
-
371
- .h-title .h-logo{
372
-
373
- width: 60%;
374
-
375
- }
376
-
377
- .m-h2, m-h3{
378
-
379
- font-size: 16px;
380
-
381
- padding: 7px 6px 7px 8px;
382
-
383
-
384
-
385
- }
386
-
387
- .m-h2::first-letter{
388
-
389
- padding-left: 8px;
390
-
391
- }
392
-
393
- .m-info-date{
394
-
395
- font-size: 8px;
396
-
397
- }
398
-
399
- .m-info-content{
400
-
401
- font-size: 8px;
402
-
403
- line-height: 1.5;
404
-
405
- }
406
-
407
- .m-info-new{
408
-
409
- font-size: 8px;
410
-
411
- padding: 1px 2px;
412
-
413
- }
414
-
415
- .m-log a{
416
-
417
- font-size: 12px;
418
-
419
- }
420
-
421
- .h-nav{
422
-
423
- display: none;
424
-
425
- }
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
- }
434
-
435
- ```