回答編集履歴

1

追記

2019/05/20 03:36

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -355,3 +355,451 @@
355
355
  }
356
356
 
357
357
  ```
358
+
359
+
360
+
361
+ ---
362
+
363
+
364
+
365
+ **追記**
366
+
367
+ 以下のようにすることで、質問者さんの実現したいことが行なえると思います([動作確認用リンク](https://codepen.io/anon/pen/byrKRW))。
368
+
369
+ ```CSS
370
+
371
+ * {
372
+
373
+ margin: 0;
374
+
375
+ padding: 0;
376
+
377
+ list-style: none;
378
+
379
+ box-sizing: border-box;
380
+
381
+ color: #333;
382
+
383
+ }
384
+
385
+
386
+
387
+ a {
388
+
389
+ text-decoration: none;
390
+
391
+ }
392
+
393
+
394
+
395
+ html,
396
+
397
+ body,
398
+
399
+ .wrapper {
400
+
401
+ height: 100%;
402
+
403
+ }
404
+
405
+
406
+
407
+ .header-wrapper {
408
+
409
+ top: 0px;
410
+
411
+ z-index: 3;
412
+
413
+ }
414
+
415
+
416
+
417
+ .topbar {
418
+
419
+ float: left;
420
+
421
+ }
422
+
423
+
424
+
425
+ .site-branding {
426
+
427
+ display: inline-block;
428
+
429
+ }
430
+
431
+
432
+
433
+ .site-message {
434
+
435
+ display: inline-block;
436
+
437
+ }
438
+
439
+
440
+
441
+ .global-nav {
442
+
443
+ width: 100%;
444
+
445
+ }
446
+
447
+
448
+
449
+ .nav-category {
450
+
451
+ width: 100%;
452
+
453
+ position: relative; /* 追加 */
454
+
455
+ }
456
+
457
+
458
+
459
+ .nav-category > a {
460
+
461
+ display: block;
462
+
463
+ width: 100%;
464
+
465
+ padding: 10px 0;
466
+
467
+ border-bottom: 1px solid #ccc;
468
+
469
+ background-color: #fff;
470
+
471
+ color: #000;
472
+
473
+ text-align: center;
474
+
475
+ }
476
+
477
+
478
+
479
+ .nav-category:first-child > a {
480
+
481
+ border-top: 1px solid #ccc;
482
+
483
+ }
484
+
485
+
486
+
487
+ .nav-container {
488
+
489
+ display: none;
490
+
491
+ position: absolute; /* 変更 */
492
+
493
+ width: 100%; /* 追加 */
494
+
495
+ z-index:1 !important;
496
+
497
+ }
498
+
499
+
500
+
501
+ .nav-contant {
502
+
503
+ position: relative;
504
+
505
+ z-index: 99;
506
+
507
+ }
508
+
509
+
510
+
511
+ .nav-contant > a{
512
+
513
+ z-index: 99;
514
+
515
+ position: relative;
516
+
517
+ display: block;
518
+
519
+ width: 100%;
520
+
521
+ padding: 10px 5%;
522
+
523
+ border-bottom: 1px solid #ccc;
524
+
525
+ background-color: #111;
526
+
527
+ color: #fff;
528
+
529
+ }
530
+
531
+
532
+
533
+ .nav-category > a:hover,
534
+
535
+ .nav-contant > a:hover {
536
+
537
+ background-color: #aaa;
538
+
539
+ }
540
+
541
+
542
+
543
+ .menu-hb {
544
+
545
+ height:100%;
546
+
547
+ text-align: right;
548
+
549
+ padding-right: 20px;
550
+
551
+ }
552
+
553
+
554
+
555
+ .menu-trigger,
556
+
557
+ .menu-trigger span {
558
+
559
+ display: inline-block;
560
+
561
+ transition: all .4s;
562
+
563
+ box-sizing: border-box;
564
+
565
+ }
566
+
567
+
568
+
569
+ .menu-trigger {
570
+
571
+ position: relative;
572
+
573
+ top:10px;
574
+
575
+ width: 40px;
576
+
577
+ height: 30px;
578
+
579
+ padding-right: 5px;
580
+
581
+ cursor: pointer;
582
+
583
+ }
584
+
585
+
586
+
587
+ .menu-trigger span {
588
+
589
+ position: absolute;
590
+
591
+ left: 0;
592
+
593
+ width: 100%;
594
+
595
+ height: 4px;
596
+
597
+ background-color: #000;
598
+
599
+ border-radius: 4px;
600
+
601
+ }
602
+
603
+
604
+
605
+ .menu-trigger span:nth-of-type(1) {
606
+
607
+ top: 0;
608
+
609
+ }
610
+
611
+
612
+
613
+ .menu-trigger span:nth-of-type(2) {
614
+
615
+ top: 13px;
616
+
617
+ }
618
+
619
+
620
+
621
+ .menu-trigger span:nth-of-type(3) {
622
+
623
+ bottom: 0;
624
+
625
+ }
626
+
627
+
628
+
629
+ #menu01:not(.active):hover span:nth-of-type(1) {
630
+
631
+ top: 2px;
632
+
633
+ }
634
+
635
+
636
+
637
+ #menu01:not(.active):hover span:nth-of-type(3) {
638
+
639
+ bottom: 2px;
640
+
641
+ }
642
+
643
+
644
+
645
+ #menu01.active span:nth-of-type(1) {
646
+
647
+ -webkit-transform: translateY(13.5px) rotate(-315deg) scale(.8);
648
+
649
+ transform: translateY(13.5px) rotate(-315deg) scale(.8);
650
+
651
+ }
652
+
653
+
654
+
655
+ #menu01.active span:nth-of-type(2) {
656
+
657
+ top: 50%;
658
+
659
+ left: 50%;
660
+
661
+ width: 40px;
662
+
663
+ height: 40px;
664
+
665
+ background-color: transparent;
666
+
667
+ border: 3px solid #000;
668
+
669
+ border-radius: 50%;
670
+
671
+ -webkit-transform: translate3d(-50%, -50%, 0);
672
+
673
+ transform: translate3d(-50%, -50%, 0);
674
+
675
+ }
676
+
677
+
678
+
679
+ #menu01.active span:nth-of-type(3) {
680
+
681
+ -webkit-transform: translateY(-13.5px) rotate(315deg) scale(.8);
682
+
683
+ transform: translateY(-13.5px) rotate(315deg) scale(.8);
684
+
685
+ }
686
+
687
+
688
+
689
+ .main-img {
690
+
691
+ width: 100%;
692
+
693
+ height: 500px;
694
+
695
+ background: red;
696
+
697
+ position: relative;
698
+
699
+ z-index: 0 !important;
700
+
701
+ }
702
+
703
+
704
+
705
+ .navbar { /* 追加 */
706
+
707
+ position: relative;
708
+
709
+ }
710
+
711
+
712
+
713
+ .navbar-innner{ /* 追加 */
714
+
715
+ position: absolute;
716
+
717
+ width: 100%;
718
+
719
+ z-index: 1;
720
+
721
+ }
722
+
723
+
724
+
725
+ @media screen and (min-width: 700px) {
726
+
727
+ .header-wrapper {
728
+
729
+ margin: 0 10%;
730
+
731
+ }
732
+
733
+
734
+
735
+ .topbar {
736
+
737
+ width: 300px;
738
+
739
+ }
740
+
741
+
742
+
743
+ .global-nav {
744
+
745
+ width: 960px;
746
+
747
+ margin-left: auto;
748
+
749
+ font-size: 0;
750
+
751
+ }
752
+
753
+
754
+
755
+ .nav-category {
756
+
757
+ display: inline-block;
758
+
759
+ width: calc(100% / 5);
760
+
761
+ font-size: 1rem;
762
+
763
+ vertical-align: top;
764
+
765
+ }
766
+
767
+
768
+
769
+ .nav-category > a {
770
+
771
+ border: none;
772
+
773
+ border-left: 1px solid #ccc;
774
+
775
+ }
776
+
777
+
778
+
779
+ .nav-category:first-child > a {
780
+
781
+ border-top: none;
782
+
783
+ }
784
+
785
+
786
+
787
+ .nav-category:last-child > a {
788
+
789
+ border-top: none;
790
+
791
+ border-right: 1px solid #ccc;
792
+
793
+ }
794
+
795
+
796
+
797
+ .navbar-innner{ /* 追加 */
798
+
799
+ position :static;
800
+
801
+ }
802
+
803
+ }
804
+
805
+ ```