我试图将两个图像彼此对齐。在IE8 +和FF中,它们对齐正确。在Internet Explorer 7中,无论我使包含图像#1和#2的左侧div有多小,图像#3都会被压低。在IE7中水平对齐图像的问题
的jsfiddle:http://jsfiddle.net/bD87z/4/
<div style="width: 490px; padding-left: 15px; padding-right: 15px; background-color: #000; padding-bottom: 10px; ">
<div id="header">
<div id="imageLeftContainer">
<div id="image1" style=""></div>
<div style="margin-top: 7px;">
<a href="http://www.google.com" target="_blank" style="text-decoration: none;"><img src="http://i40.tinypic.com/a40ntg.png" style="margin: 0; padding: 0; border: none;" /></a>
</div>
</div>
<a href="http://www.google.com" target="_blank" style="text-decoration: none;"><img id="image3" src="http://i41.tinypic.com/n5mzxi.png" /></a>
</div>
</div>
CSS:
#header
{
clear: both;
}
#imageLeftContainer
{
width: 292px;
display: inline-block;
margin: 0;
padding: 0;
margin-top: 20px;
zoom:1;
*display: inline;
_height: 100%;
}
#image1
{
width: 292px;
height: 64px;
margin: 0;
padding: 0;
margin-top: 5px;
background: url(http://i40.tinypic.com/2z8w4uc.png);
}
#image3
{
float: right;
width: 185px;
height: 108px;
margin: 0;
padding: 0;
margin-top: 15px;
border: none;
}
现在告诉我谁的心情和耐心跟进你完全搞砸代码。首先让一些可读的HTML和CSS分离出来,然后我们可以谈谈。 – 2012-02-27 16:29:32
这些内嵌样式融化了我的眼睛。 – JKirchartz 2012-02-27 16:31:13
我的歉意 - 我现在更新了jsFiddle @SvenBieder。 – 2012-02-27 16:36:22