Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 浏览器9中的背景位置_Html_Css_Internet Explorer 9 - Fatal编程技术网

Html 浏览器9中的背景位置

Html 浏览器9中的背景位置,html,css,internet-explorer-9,Html,Css,Internet Explorer 9,我对身体背景的定位有问题。它是这样的: <script type="text/javascript"> <!--body id="body" style=" text-align:center; background-color:#031a43; background-image : url('design/bgFrontPage.jpg'); background-repeat:no-repeat;

我对身体背景的定位有问题。它是这样的:

<script type="text/javascript">
    <!--body id="body" style="
        text-align:center;
        background-color:#031a43;
        background-image : url('design/bgFrontPage.jpg');
        background-repeat:no-repeat;
        background-position: top center;" //-->
</script>
在所有浏览器中都可以正常工作,除了IE 9中bg向左移动

有什么想法吗?

很奇怪

我在我的页面中尝试以下代码:

<head>
    <title></title>
    <style type="text/css">
        .bg
        {
            text-align: center;
            background-color: #031a43;
            background-image: url('Styles/166894621.jpg');
            background-repeat: no-repeat;
            background-position: top center;
        }
    </style>
</head>
<body class="bg">
</body>

背景图像位于中间。

我希望通过在html头部的meta行下方添加,IE9/any可以呈现为IE8

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>

你试过用Firebug调试吗?你的代码已经够奇怪的了。你确定JS解析器接受CSS吗?这是现有网站的权宜之计。在新内容上主动使用它是个坏主意。