私は何かを作成しようとしています
<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;}
しかし、絶対位置で画像を垂直方向に中央揃えしようとすると、すべてのデザインが乱れます。
画像は動的で、固定サイズはありません。
また、 .divimage の高さを px に変更すると受け入れられますが、 % の場合は高さが 0px になります。
この画像を垂直方向に中央揃えにするにはどうすればよいですか。それとも私は何かを逃していますか?
ありがとうございました