我有多个图像,当调整网页大小时应该左对齐,但仍然保持 div 块居中。他们目前都被居中:
见下文:
这是我的 HTML 和 CSS 代码:
<div class="widget-content" style="text-align:center;">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
<img class="medium_thumb_rounded" id="15" src="my-img-src.jpg">
</div>
CSS:
.widget-content {
padding: 12px 15px;
border-bottom: 1px solid #cdcdcd;
}
.medium_thumb_rounded {
border: 1px solid #B6BCBF;
/*float: left;*/
height: 80px;
width: 80px;
margin-right: 1px;
margin-bottom: 5px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
知道我做错了什么吗?