我对 IE 中的某些图像有问题,它们垂直对齐而不是水平对齐,但是它们在所有其他浏览器中都正常吗?此外,当使用 IE8 和 7 时,图像根本无法显示!有什么办法可以解决这个问题吗?我在下面附上了我的代码:
<div class="header_right_christmas">
<div class="preflang_christmas">
<a href="#" class="delivery_xmas">
</a>
<a href="#" target="_blank" class="facebook_xmas">
</a>
<a href="#" target="_blank" class="twitter_xmas">
</a>
<a href="#" target="_blank" class="pintrest_xmas">
</a>
<a href="#" target="_blank" class="google_xmas">
</a>
</div>
.preflang_christmas {float:right; display:inline-flex;}
.delivery_xmas {
height:40px;
width:196px;
display:block;
background-image:url('myimage.png')no-repeat;
}
.delivery_xmas:hover {
background-image:url('myimage.png');
}
.facebook_xmas {
width:40px;
height:40px;
display:block;
background:transparent url('myimage.png')no-repeat;
}
.facebook_xmas:hover {
background-image:url('myimage.png');
}
.twitter_xmas {
height:40px;
width:40px;
display:block;
background:transparent url('myimage.png')no-repeat;
}
.twitter_xmas:hover {
background-image:url('Christmas_Homepage_Images/twitter.png');
}
.pintrest_xmas {
height:40px;
width:40px;
display:block;
background:transparent url('Christmas_Homepage_Images/pintrest_bw.png')no-repeat;
}
.pintrest_xmas:hover {
background-image:url('Christmas_Homepage_Images/pintrest.png');
}
.google_xmas {
height:40px;
width:40px;
display:block;
background:transparent url('Christmas_Homepage_Images/google_plus_bw.png')no-repeat;
}
.google_xmas:hover {
background-image:url('Christmas_Homepage_Images/google_plus.png');
}
最佳答案
设法通过从背景图像中删除 no-repeat
来修复!
关于html - 图像在 IE 中垂直对齐而不是水平对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20051101/