用于display: inline-block;
外部和内部元素。您需要强制执行最大宽度吗?
HTML
<div class="outer">
<img src="http://www.bostonbakesforbreastcancer.org/wp-content/uploads/2012/03/sun.jpg" class="inner" />
<img src="http://www.bostonbakesforbreastcancer.org/wp-content/uploads/2012/03/sun.jpg" class="inner" />
<img src="http://www.bostonbakesforbreastcancer.org/wp-content/uploads/2012/03/sun.jpg" class="inner" />
</div>
CSS
.outer{
background: black;
display: inline-block;
padding: 10px 10px 5px 10px;
}
.inner {
background: yellow;
display: inline-block;
width: 50px;
}
小提琴叉。