ナビのCSSが多くなり、邪魔に感じたのでをstyle.cssから別ファイルに記述したところ表示がおかしくなりました。
ナビのCSSファイルの読み込みに問題が生じているのかと考え、元のstyle.cssに戻したのですが元に戻りません。
デベロッパーツールで見てもul以下にCSSが適応されません。
どなたかアドバイスお願いします。
HTML
1 <div id="nav-toggle"> 2 <div> 3 <span></span> 4 <span></span> 5 <span></span> 6 </div> 7 </div> 8 <nav class="global_navi_l"> 9 <ul> 10 <li><i class="fas fa-sun"></i></li> 11 <li><a href="index.html">Home</a></li> 12 <li><a href="about.html">About</a></li> 13 <li><a href="portfolio.html">Portfolio</a></li> 14 <li><a href="aboutus.html">Contact</a></li> 15 <li><a href="blog.html">Blog</a></li> 16 <li><a href="https://twitter.com/paraonde_futsal"><i class="fab fa-twitter"></i></a></li> 17 </ul> 18 </nav> 19 <nav class="global_navi_s"> 20 <ul> 21 <li><i class="fas fa-sun"></i></li> 22 <li><a href="index.html">Home</a></li> 23 <li><a href="about.html">About</a></li> 24 <li><a href="portfolio.html">Portfolio</a></li> 25 <li><a href="aboutus.html">Contact</a></li> 26 <li><a href="blog.html">Blog</a></li> 27 <li><a href="https://twitter.com/paraonde_futsal"><i class="fab fa-twitter"></i></a></li> 28 </ul> 29 </nav>
CSS
1.global_navi_l nav ul{ 2 /*スクロールされた時だけ適応*/ 3 background-color: rgba(255,255,255,0.5); 4 5 display: flex; 6 justify-content: center; 7 align-items: center; 8 9 list-style: none; 10 position: fixed; 11 z-index: 3; 12 height: 50px; 13 width: 100% 14} 15.global_navi_l nav ul li { 16 17 display: inline-block; 18 text-align: left; 19} 20.global_navi_l nav ul li a{ 21 color: #444444; 22 display: block; 23 font-size: 20px; 24 margin: 0px 20px; 25 padding: 0px; 26 text-decoration: none; 27} 28 29.global_navi_l nav ul li a:hover{ 30 color: #FF9933; 31 text-decoration: none; 32} 33.global_navi_l nav ul li a:after{ 34 content: ''; 35 width: 0; 36 transition: all 0.3s ease; 37 border-bottom: 3px solid #FF9933; 38 display: block; 39} 40 41.global_navi_l nav ul li a:hover:after { 42 width: 100%; 43 border-bottom: 3px solid #FF9933; 44} 45 46.global_navi_l nav ul li a:after { 47 left: 0; 48} 49 50.global_navi_l ul li:nth-child(1){ 51 justify-self: flex-start; 52} 53 54.global_navi_s{ 55 opacity: 0; 56} 57 58 59 60 61 62 63 64@media(max-width: 767px){ 65 .global_navi_l{ 66 opacity: 0; 67 } 68 69 70 #nav-toggle { 71 justify-self: end; 72 align-self: center; 73 74 top: 25px; 75 right: 25px; 76 height: 32px; 77 } 78 #nav-toggle > div { 79 position: relative; 80 width: 36px; 81 } 82 #nav-toggle span { 83 width: 100%; 84 height: 1px; 85 left: 0; 86 display: block; 87 background: #333; 88 position: absolute; 89 transition: top .5s ease, -webkit-transform .6s ease-in-out; 90 transition: transform .6s ease-in-out, top .5s ease; 91 transition: transform .6s ease-in-out, top .5s ease, -webkit-transform .6s ease-in-out; 92 } 93 #nav-toggle > div >span:nth-child(1) { 94 top: 0; 95 } 96 #nav-toggle > div >span:nth-child(2) { 97 top: 14px; 98 } 99 #nav-toggle > div >span:nth-child(3) { 100 top: 28px; 101 } 102 103 104 #nav-toggle:hover span:nth-child(1) { 105 top: 4px; 106 } 107 #nav-toggle:hover span:nth-child(3) { 108 top: 23px; 109 } 110 111 112 113 .open #nav-toggle span { 114 background: #fff; 115 } 116 .open #nav-toggle span:nth-child(1) { 117 top: 15px; 118 -webkit-transform: rotate(45deg); 119 transform: rotate(45deg); 120 } 121 .open #nav-toggle span:nth-child(2) { 122 top: 15px; 123 width: 0; 124 left: 50%; 125 } 126 .open #nav-toggle span:nth-child(3) { 127 top: 15px; 128 -webkit-transform: rotate(-45deg); 129 transform: rotate(-45deg); 130 } 131 132 133 .global_navi_s { 134 background: #550000; 135 color: #fff; 136 position: fixed; 137 top: 0; 138 left: 0; 139 right: 0; 140 bottom: 0; 141 z-index: 999; 142 text-align: center; 143 display: flex; 144 visibility: hidden; 145 flex-direction: column; 146 justify-content: center; 147 align-items: center; 148 font-size: 29px; 149 opacity: 0; 150 transition: opacity .6s ease, visibility .6s ease; 151 } 152 .global_navi_s a{ 153 display: block; 154 color: #fff; 155 text-decoration: none; 156 padding: 10px 0; 157 transition: color .6s ease; 158 } 159 .global_navi_s a:hover { 160 color: #666; 161 } 162 .global_navi_s ul { 163 list-style: none; 164 } 165 .global_navi_s ul li { 166 opacity: 0; 167 -webkit-transform: translateX(200px); 168 transform: translateX(200px); 169 transition: opacity .2s ease, -webkit-transform .6s ease; 170 transition: transform .6s ease, opacity .2s ease; 171 transition: transform .6s ease, opacity .2s ease, -webkit-transform .6s ease; 172 } 173 .global_navi_s ul li:nth-child(2) { 174 transition-delay: .15s; 175 } 176 .global_navi_s ul li:nth-child(3) { 177 transition-delay: .3s; 178 } 179 .global_navi_s ul li:nth-child(4) { 180 transition-delay: .45s; 181 } 182 .global_navi_s ul li:nth-child(5) { 183 transition-delay: .6s; 184 } 185 .global_navi_s ul li:nth-child(6) { 186 transition-delay: .75s; 187 } 188 .global_navi_s ul li:nth-child(7) { 189 transition-delay: .9s; 190 } 191 192 .open { 193 overflow: hidden; 194 } 195 .open .global_navi_s { 196 visibility: visible; 197 opacity: 1; 198 } 199 .open .global_navi_s li { 200 opacity: 1; 201 -webkit-transform: translateX(0); 202 transform: translateX(0); 203 transition: opacity .9s ease, -webkit-transform 1s ease; 204 transition: transform 1s ease, opacity .9s ease; 205 transition: transform 1s ease, opacity .9s ease, -webkit-transform 1s ease; 206 } 207 208}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/21 10:11