我有一个身体背景,我有一个div在那个body.On窗口调整大小,我想有这样的应用程序。为了保持宽度,如果我给身体固定的宽度,在窗口调整大小我没有得到滚动条,因此整个页面不显示。如果我不给定固定宽度,页面对齐会发生变化,并且它会在窗口大小调整时崩溃。这是我的代码。提前感谢。如何在窗口大小上调整固定宽度?
body.background
{
background: url(../images/common/header/Background_color.png);
background-repeat:repeat-x;
background-attachment:fixed;
background-position:top center;
height: 100%;
width: 100%;
border: 0;
background-size:contain;
position:fixed;
overflow:auto;
}
div.emptybody
{
height:100%;
width:97%;
background-color: rgb(255, 255, 255);
margin: 0px 25px 25px 25px;
height:470px;
background-position:center;
background-repeat:no-repeat;
background-attachment:fixed;
}
<body class="background">
<div class="emptybody">
-------------other elements and contents---------------
</div>
</body>
其实我试图让固定宽度的身体。那时,如果我调整大小,只会显示页面的一部分。 – kishore
我的应用程序看起来像我有一个背景,在中心我有这个emptybody div。现在,您可以在emptybody div的顶部,底部,左侧和右侧看到背景。但是,如果我将固定宽度指定为emptybody div,并且如果我调整大小,那么当时我无法看到右侧的背景。我希望你明白我的意思。 – kishore