【发布时间】:2014-06-10 13:32:27
【问题描述】:
我有一个位于锚元素中的图像。
我希望锚点和图像在父 div 中垂直和水平居中。
Here 是一个例子:
<div class="wrapper">
<a href="#" class="anchor">
<img src="http://bit.ly/1mFH8AW"></img>
</a>
</div>
.wrapper {
background: black;
width: 500px;
height: 500px;
}
.anchor {
}
.anchor > img {
height: 100px;
width: 100px;
}
结果:
【问题讨论】:
标签: image css alignment anchor