我有一个div,我想在该div的多个图像的中心对齐。所有图像的高度和宽度都相同,为16像素。问题是,我可以将它们居中,并且在下面有额外的空间,但是当我使用display:block来删除它们时,它们再次对齐在左边。这是我的代码:
我想要包含图像的div:
.cell{
position: relative;
float: left;
width: 300px;
min-height: 22px;
border-bottom: 1px solid #000;
border-right: 1px solid #000;
line-height: 22px;
font-family: Arial, Verdana;
font-size: 12px;
color: #000;
text-decoration: none;
text-align: center;
margin-bottom: 2px;
margin-right: 2px;
}
上述类具有一般需要的属性。
所以我想为img元素创建一个类,以便它们可以相互对齐,并且所有对齐在一起。
任何工作建议? 🙂