我正在制作一个在每个页面上都有背景图片的网站。该图像在 Chrome、Safari、Firefox 中居中...但它不会在 IE 9 中居中(不确定其他版本的 IE)。
这是 CSS:
#page {
background-image: url(images/mountain2.jpg);
text-align: center;
margin-top: -50px;
margin-right: auto;
margin-left: auto;
background-repeat: no-repeat;
background-color: #6C86FF;
width:1292;
height:972;
}
(#page,是整个站点的div标签。)
帮助,非常感谢。 =)
最佳答案
你试过设置background-position: center center;
吗?
关于css - 背景图像不会在 IE 9 中居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9863169/