在IE 9中背景图片不会居中 [英] Background Image won't center in IE 9

查看:55
本文介绍了在IE 9中背景图片不会居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个每页都有背景图片的网站.该图像位于Chrome,Safari,Firefox中……但是不会在IE 9中(不确定其他版本的IE)中.

I'm making a site with a background image on every page. The image is centered in Chrome, Safari, Firefox... But it won't center in IE 9 (not sure about the other versions of 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标签.)

(#page, is the div tag for the entire site.)

非常感谢您的帮助.=)

Help, is very much appreciated. =)

推荐答案

您是否尝试过设置 background-position:center center; ?

这篇关于在IE 9中背景图片不会居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆