【发布时间】:2014-11-11 09:28:49
【问题描述】:
我以这种方式在我的网站上放置圆形图片:
HTML:
<table class="profiles-table">
<td>
<div class="david-circle profile-circle"></div>
</td>
<td>
<div class="david-circle profile-circle"></div>
</td>
<td>
<div class="david-circle profile-circle"></div>
</td>
</table>
CSS:
table.profiles-table {
width:100%;
}
table.profiles-table td {
vertical-align:top;
text-align:center;
width:33%;
}
div.david-circle {
background: url(./images/david.jpg) no-repeat;
}
div.profile-circle {
margin-bottom:30px;
width: 150px;
height: 150px;
border-radius: 75px;
-webkit-border-radius: 75px;
-moz-border-radius: 75px;
}
这不会使圆形图像居中对齐。如果我用文本替换 div,它是居中对齐的。如果我使用 img src="blah",它也可以。我是不是做错了什么?
谢谢!
【问题讨论】:
-
background-position: center center?