到目前为止,我已经拥有一个响应迅速的网站,该网站可以按要求运行,但是设置了移动导航后,我网站上的所有链接都无法点击或无法悬停。我假设这是有关导航背景的宽度和高度的问题,但是我希望移动导航在单击时能填满整个屏幕。
请参阅下面的代码;
nav.mobile {
display: block;
position: fixed;
top: 6.2rem;
width: 100%;
height: 100%;
background-color: #fff;
z-index: 3;
box-shadow: 0px 1px 0px 0px rgba(41, 70, 97, 0.2);
transform: translate(0, -160px);
transition: all 0.3s ease-out;
padding-bottom: 0rem;
opacity: 0;
//added this for demo only. On a mobile device max width is not necessary.
}
nav.mobile--open {
transform: translate(0, 0);
opacity: 1;
}
nav.mobile ul {
list-style-type: none;
padding: 0;
margin: 0;
}
nav.mobile li.link {
font-family: "Colfax-Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 400;
font-size: 1rem;
padding: 1.5rem 0 0.5rem 1.5rem;
}
nav.mobile li.link a {
color: $blue_bg;
display: block;
text-decoration: none;
&:hover{
color: $green;
}
}
任何帮助都非常感谢!
最佳答案
您是否尝试过以vh
单位增加高度
nav.mobile--open {
transform: translate(0, 0);
opacity: 1;
height: 100vh;
overflow: auto;
}
关于javascript - 移动导航覆盖问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40910316/