html代码:
<div class="nav-body">
<ul class="nav-img">
<li>
<a href=""><img src="images/ChMkJlrxCxeICdF1AAIP3kkPOFcAAoJhgLLJ_QAAg_2532.jpg" alt="献礼母亲节"></a>
</li>
</ul>
<div class="nav-warpper">
<div class="nav-menu">
<ul>
<li><a href="">手机</a></li>
<li><a href="">电脑</a></li>
<li><a href="">DIY</a></li>
<li><a href="">数码</a></li>
<li><a href="">外设</a></li>
<li><a href="">智能</a></li>
</ul>
</div>
</div>
</div>
css代码:
.nav-body{
position: relative;
overflow: hidden;
width:100%;
height: 400px;
}
.nav-img{
position: absolute;
z-index:-1;
}
.nav-img a{
display: block;
width:100%;
}
.nav-img img{
height: 400px;
width:100%;
min-width: 1920px;
}
.nav-warpper{
width:1200px;
margin: 0 auto;
}
.nav-menu{
display: inline-block;
width:150px;
height: 400px;
background: #666;
z-index: 2;
}
.nav-menu li{
display: inline-block;
width:150px;
padding:15px 0;
border-top:1px solid #e6e6e6;
}
.nav-menu li:hover{
background: #ec3639;
}
pc端效果:
Iphone6/7/8效果:
补充:使用了viewport
<meta name="viewport" content="width=device-width, initial-scale=1.0">
最后:为什么后出现这种问题,怎么解决?
慕的地6079101
maturity_process
小草1434
兼容并包
Gotta