どんなにright-◯◯%と書いても横幅が広くなるだけでメニューが隠れてくれません。
どうやったらメニュー部分が隠れるのかを教えていただきたいです。
よろしくお願いします。
html
1<header> 2 <div class="hd-wrap"> 3 <img class="hd-logo" src="img/logo.png" alt=""> 4 <ul class="hd-list"> 5 <li class="hd-item"><a href="">Card<span><i class="fas fa-angle-right"></i></span></a></li> 6 <li class="hd-item"><a href="">News<span><i class="fas fa-angle-right"></i></span></a></li> 7 <li class="hd-item"><a href="">Price<span><i class="fas fa-angle-right"></i></span></a></li> 8 <li class="hd-item"><a href="">Access<span><i class="fas fa-angle-right"></i></span></a></li> 9 <li class="hd-item"><a href="">Contact<span><i class="fas fa-angle-right"></i></span></a></li> 10 </ul> 11 </div> 12 <div class="black-bg" id="ja-black-bg"></div> 13 <div class="hum" id="js-hum"> 14 <span class="hum-linn hum-line-1"></span> 15 <span class="hum-linn hum-line-2"></span> 16 <span class="hum-linn hum-line-3"></span> 17 </div> 18 </header>
scss
1header { 2 background: $blue; 3 box-shadow: 0 3px 3px #00000029; 4 color: #fff; 5} 6 7.hd-wrap { 8 display: flex; 9 justify-content: space-between; 10 padding: 31px 138px 30px 139px; 11 12 @include sp { 13 padding: 15px 0; 14 position: relative; 15 } 16 17 .hd-logo { 18 cursor: pointer; 19 transition: .5s linear; 20 &:hover { 21 transform: rotateX(360deg); 22 } 23 } 24 25 .hd-list { 26 display: flex; 27 justify-content: space-between; 28 29 @include sp { 30 display: block; 31 position: absolute; 32 right: -50%; 33 top: 0; 34 z-index: 200; 35 background: #fff; 36 width: 50%; 37 height: 100vh; 38 color: #707070; 39 } 40 41 .hd-item { 42 margin-right: 26px; 43 line-height: 39px; 44 position: relative; 45 46 @include sp { 47 margin-right: 0; 48 } 49 50 a { 51 display: block; 52 padding: 15px 20px; 53 } 54 55 &::after { 56 position: absolute; 57 content: ""; 58 height: 3px; 59 width: 100%; 60 background: #E81919; 61 bottom: 0; 62 left: 0; 63 opacity: 0; 64 transition: .3s; 65 66 @include sp { 67 background: none; 68 border-bottom: 1px dotted #707070; 69 opacity: 1; 70 } 71 } 72 73 &:hover::after { 74 opacity: 1; 75 } 76 77 &:last-child { 78 margin-right: 0; 79 } 80 81 span { 82 display: none; 83 @include sp { 84 display: inline-block; 85 position: absolute; 86 right: 20px; 87 88 } 89 } 90 } 91 } 92}
回答3件
あなたの回答
tips
プレビュー