这是我创建的 CSS 菜单。
当我在我的手机 (iPhone 6) 中看到这个时,最后一个菜单 (Menu4) 根本不显示。前 3 个菜单从电话屏幕的左侧延伸到右侧。我不知道为什么。
有人可以帮忙吗?
这是HTML部分
<hr class="navHr">
<nav id="m">
<a href="#" data-mirror="Menu1">Menu1</a>
<a href="#" data-mirror="Menu2">Menu2</a>
<a href="#" data-mirror="Menu3">Menu3</a>
<a href="#" data-mirror="Menu4">Menu4</a>
</nav>
<hr class="navHr">
和 CSS 部分
.navHr {
border: 0;
height: 0.1em;
margin: 0;
background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
}
nav {
height: 2em;
background: #000;
background: linear-gradient(to bottom, rgba(76, 76, 76, 1) 0%, rgba(44, 44, 44, 1) 50%, rgba(0, 0, 0, 1) 51%, rgba(19, 19, 19, 1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 );
line-height: 2em;
text-transform: uppercase;
text-align: center;
min-width: 2em;
position: relative;
}
nav::before {
background: linear-gradient(to top, rgba(76, 76, 76, 0) 0%, rgba(44, 44, 44, 1) 50%, rgba(0, 0, 0, 1) 51%, rgba(19, 19, 19, 1) 100%);
content: '';
display: block;
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 100%;
opacity: 0.09;
}
nav a {
color: #FFF;
text-decoration: none;
font-weight: bold;
font-size: 1.2em;
border-right: solid 0.1em #FFF;
height: 100%;
padding: 0.25em 3em;
position: relative;
}
nav a:first-child {
border-left: solid 0.1em #FFF;
}
nav a::before {
content: attr(data-mirror);
position: absolute;
top: 100%;
left: 3em;
color: #000;
transform: scaleY(-1);
color: #FFF;
opacity: 0.5;
}
#m {
background-color: #000000;
}