<div class="box1">
<div class="tab_list">
<ul>
<li class="current">introduction</li>
<li>specification</li>
<li>after sale</li>
<li>commit</li>
<li>community</li>
</ul>
</div>
<div class="tab_con">
<div class="item">
商品介绍
</div>
<div class="item">
规格与包装
</div>
<div class="item">
售后保障
</div>
<div class="item">
用户评价
</div>
<div class="item">
手机社区
</div>
</div>
</div>
在设定了border-box之后仍然会出现溢出,原因是height使用100%来继承高度,会导致border-box失效
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.tab_list {
height: 50px;
width: 100%;
line-height: 50px;
text-align: center;
color: #333;
}
.tab_list li {
float: left;
height: 100%;//此处修改成50px即可
padding: 0 10px;
border: 2px solid #ccc;
margin-left: -2px;
}