我正在尝试将左对齐图像的 div 块居中。这是屏幕截图:
期望的结果是这样的:
我的 HTML 是这样的:
<div style="margin-left:auto; margin-right:auto;padding:10px 0 0 0;">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
<img class="medium_thumb_rounded" id="15" src="medium_thumb.jpg">
</div>
当前的 CSS:
.medium_thumb_rounded {
display:inline-block;
border: 1px solid #B6BCBF;
height: 80px;
margin-right: 1px;
margin-bottom: 5px;
width: 80px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
我错过了什么?