我试图创造一些垂直居中对齐图像与绝对位置
<div class="model-info">
<div class="mainholder">
<div class="divImage centeredImageContainer" align="center">
<a href="talent_view.aspx?uid=e7385d69-8659-4ab4-a55d-d693ca9ba816">
<img class='centeredImage' style='width:80px;' src="http://t0.gstatic.com/images? q=tbn:ANd9GcRX9N8qSDD4OhL9XH0N8RTbf3bObBR5TrqKeyUFxi-ZpAKQxyVsrw" alt="Anne" title="Anne">
</a>
</div>
的CSS是:
.centeredImageContainer
{
position:relative;
}
.centeredImage
{position: absolute;
top: 0;
bottom: 0;
margin: auto;
left: 0;
right: 0;}
但是,当我尝试垂直居中与图像绝对位置干扰了所有设计,
图像是动态的没有修复大小。
另外,当我改变px中的.divimage高度时,它接受,但是当它在%时,它的高度为0px。
我如何设置此图像垂直居中。 或者我错过了什么?
谢谢
请通过这些小提琴链接.... – Rohit 2013-02-16 09:30:38