webサイト上にサイトを公開した際、レスポンシブ状態のpcやアンドロイド端末では左右から出現するドロワーメニューが、iPhoneでは出現せず、ここ2日悩まされております。z-indexの問題かなと対策を調べ実践してみたのですがうまくいかず、。
見た目は表示されていないように見えるのですが、ドロワーメニューを開いたときになぜかその中にあるリンクはタップすることができます。
どなたか解決策を教えて頂けたらとても嬉しいです。。
HTML
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet"> <link rel="stylesheet" href="../css/main.css"> <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.css"> <link rel="stylesheet" href="../css/swiper.css"> <link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet"> <title>landing page</title> </head> <body> <div class="header2"> <input type="checkbox" class="openSidebarMenu" id="openSidebarMenu"> <label for="openSidebarMenu" class="sidebarIconToggle"> <div class="spinner diagonal part-1"></div> <div class="spinner horizontal"></div> <div class="spinner diagonal part-2"></div> </label> <div id="sidebarMenu"> <ul class="sidebarMenuInner"> <li><a href="#" target="_blank">Home</a></li> <li><a href="#" target="_blank">Events</a></li> <li><a href="#" target="_blank">Profile</a></li> <li><a href="#" target="_blank">Log out</a></li> </ul> </div> <input type="checkbox" class="openSidebarSearch" id="openSidebarSearch"> <label for="openSidebarSearch" class="sidebarIconSearch"> <i class="fas fa-search search_icon"></i> </label> <div id="sidebarSearch"> <div class="search-erea"> <div class="search-title">Enter the name of event</div> <input type="text" class="search_text"> <div class="search-erea"> <div class="search-title">Day</div> <input type="text" class="Day-box"> </div> </div> </div> <div class="background-img"> </div> </body> </html>
CSS
#chk { position: absolute; visibility: hidden; z-index: -1111; } .header2{ display: none; } @media screen and (max-width: 767px) { #header { display: none; } .header2 { display: block; width: 100%; max-width: 100%; -webkit-box-shadow: none; box-shadow: none; position: fixed; height: 50px; background: #2D2524; overflow: hidden; z-index: 10; } .background-img { color: #000000; height: 100vh; width: 100%; } #sidebarSearch { position: relative; height: 100%; left: 0; width: 100%; margin-top: 50px; -webkit-transform: translateX(1500px); transform: translateX(1500px); -webkit-transition: -webkit-transform 0.6s ease-in-out; transition: -webkit-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out; background: #454545; color: #fff; position: fixed; text-align: center; } .sidebarIconSearch i { color: #fff; -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: pointer; position: absolute; top: 16px; right: 25px; z-index: 99; font-size: 20px; } input[type="checkbox"]:checked ~ #sidebarSearch { -webkit-transform: translateX(0); transform: translateX(0); } input[type="checkbox"]:checked ~ #sidebarSearch ~ .sidebarIconToggle { display: none; } .openSidebarSearch { float: right; } .search-title { font-size: 20px; font-weight: bold; margin: 20px 0 10px; } .search_text { outline: none; height: 30px; width: 60%; border: solid 3px #fff; background: none; border-radius: 30px; color: #fff; padding: 0 20px; font-size: 16px; } #select { width: 60%; } #sidebarMenu { position: relative; width: 100%; height: 100%; position: fixed; left: 0; margin-top: 50px; -webkit-transform: translateX(-1500px); transform: translateX(-1500px); -webkit-transition: -webkit-transform 0.6s ease-in-out; transition: -webkit-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out; background: #454545; } .sidebarMenuInner { position: absolute; text-align: center; top: 40%; left: 50%; -webkit-transform: translateY(-50%) translateX(-50%); transform: translateY(-50%) translateX(-50%); margin: 0; padding: 0; } .sidebarMenuInner li { text-align: center; list-style: none; color: #fff; text-transform: uppercase; font-weight: bold; font-size: 20px; padding: 30px; cursor: pointer; } .sidebarMenuInner li a { color: #fff; text-transform: uppercase; font-weight: bold; cursor: pointer; text-decoration: none; } input[type="checkbox"]:checked ~ #sidebarMenu { -webkit-transform: translateX(0); transform: translateX(0); } input[type="checkbox"]:checked ~ #sidebarMenu ~ .sidebarIconSearch { display: none; } input[type="checkbox"]:checked ~ #sidebarMenu ~ #sidebarSearch { display: none; } input[type=checkbox] { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; display: none; } .sidebarIconToggle { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: pointer; position: absolute; z-index: 99; height: 100%; width: 100%; top: 18px; left: 20px; height: 22px; width: 22px; } .spinner { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 3px; width: 100%; background-color: #fff; } .horizontal { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; position: relative; float: left; margin-top: 3px; } .diagonal.part-1 { position: relative; -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; float: left; } .diagonal.part-2 { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; position: relative; float: left; margin-top: 3px; } input[type=checkbox]:checked ~ .sidebarIconToggle > .horizontal { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; opacity: 0; } input[type=checkbox]:checked ~ .sidebarIconToggle > .diagonal.part-1 { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transform: rotate(135deg); transform: rotate(135deg); margin-top: 8px; } input[type=checkbox]:checked ~ .sidebarIconToggle > .diagonal.part-2 { -webkit-transition: all 0.3s; transition: all 0.3s; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transform: rotate(-135deg); transform: rotate(-135deg); margin-top: -9px; } } * { margin: 0; padding: 0; font-weight: 100; } body { background-color: black; } /*# sourceMappingURL=main.css.map */
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。