当头部元素固定时,会遮挡到其他元素,解决方法如下:
header使用了position:fixed
给header盒子外再套另一个盒子box
<div class="box">
<div class="header">
......
</div>
</div>
.header{
color: #999;
background: #e3e4e5;
height: 40px;
line-height: 40px;
margin: 0;
width: 100%;
left: 0;
right: 0;
position: fixed;
}
.box{
height: 50px;
}