如果有人能帮我解决这个问题,我将不胜感激。
我有 this site在暂存链接上。在 Safari 和 Firefox 中一切正常。但是在 Internet Explorer(我相信是第 9 版)中,背景图像出现在最右边,即不在中心。
行为不端的 IE 图片:
由于每个页面的背景图片不同,代码如下
body {background-color:#000; color:#FFF; margin:0px; padding:0px;height:100%;}
#home {background:url(../images/Background2.jpg) top center no-repeat;background-color:#000;}
对于 Internet Explorer v9 或更低版本,我包括:
#home {text-align:center;}
我已经阅读了其他帖子,但似乎找不到答案。非常感谢您的意见!
最佳答案
可能是背景的隐式位置在 IE si 中向左,在 Chrome 中为中心。
尝试使用 background-position:center center
。
关于css - 背景图像不会在 Internet Explorer 中居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15151789/