我有这个盒子,我想让它响应
h2{
margin: 0;
padding: 0;
border: 0;
}
ul {
background: #fff;
float: left;
padding: 15px 0;
width: 655px;
border: 1px solid #000;
border-bottom: 0;
}
ul li {
float: left;
/*width: auto;*/
text-align: center;
width: 202px;
padding: 0 8px;
margin-bottom: 7px;
}
ul li .img{
position: relative;
border: 1px solid #000;
/*padding: 10px;*/
padding: 0;
text-align: center;
}
.info {
background: orange;
border: 1px solid #000;
padding: 0 6px 5px;
border-width: 0 1px 2px 1px;
}
<ul>
<li><div class="img"><img src="https://static.icecreamapps.com/images/bighelpicon.png" /></div>
<div class="info">
<h2>contact us</h2>
</div>
</li>
<li><div class="img"><img src="https://static.icecreamapps.com/images/bighelpicon.png" /></div>
<div class="info">
<h2>contact us</h2>
</div>
</li>
<li><div class="img"><img src="https://static.icecreamapps.com/images/bighelpicon.png" /></div>
<div class="info">
<h2>contact us</h2>
</div>
</li>
</ul>
我想使ul
100% 宽度和 li 以填充为中心,但如果 add padding
,li
则超出ul
宽度。我不想用box-sizing
webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
请问有没有其他方法可以box-sizing
实现这一目标?