Css 在内部div上使用[margin:0 auto;]时出现背景色/图像错误

Css 在内部div上使用[margin:0 auto;]时出现背景色/图像错误,css,background,margin,Css,Background,Margin,在我的示例(下面的链接)中,当浏览器大小小于定义的内部DIV宽度(960px)时,外部DIV的一些背景会神奇地消失。水平滚动条会按预期启动,但当您向右滚动时,您不会看到图像中缺少的部分。我相信这与内部DIV的属性[margin:0 auto;]有关,因为当从代码中取出内部DIV时,外部DIV的背景会显示为它应该显示的样子(它会被截断,但没有滚动条) 有人知道为什么会发生这种情况……以及如何解决吗?: Html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTM

在我的示例(下面的链接)中,当浏览器大小小于定义的内部DIV宽度(960px)时,外部DIV的一些背景会神奇地消失。水平滚动条会按预期启动,但当您向右滚动时,您不会看到图像中缺少的部分。我相信这与内部DIV的属性[margin:0 auto;]有关,因为当从代码中取出内部DIV时,外部DIV的背景会显示为它应该显示的样子(它会被截断,但没有滚动条)

有人知道为什么会发生这种情况……以及如何解决吗?:

Html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Background Problem</title>
<style>
</head>
<body>
<div id="outer">
<div id="inner"></div>
</div>
</body>
</html>

亲爱的,看看我的答案,让我知道,如果我落后了一些地方…谢谢你的答复-但这段代码并不能解决问题。同样的情况也会发生(当浏览器宽度小于960px时,background-picture.jpg部分消失)。
body {
    margin: 0 auto;
}
#outer {
    background: url("background-picture.jpg") no-repeat scroll center top transparent;
    height: 500px;
}
#inner {
    background: url("diagonal-lines.png") repeat scroll 0 0 transparent;
    height: 500px;
    margin: 0 auto;
    width: 960px;
}