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吗?这是现有网站的权宜之计。在新内容上主动使用它是个坏主意。