ボディの背景があり、そのボディに div があります。ウィンドウのサイズ変更時に、アプリケーションをそのようにしたいです。幅を維持するために、本体に固定幅を指定すると、ウィンドウのサイズ変更時にスクロールバーが表示されず、その結果、ページ全体が表示されません。固定幅を指定しないと、ページの配置が変更され、ウィンドウのサイズ変更時に本文内の要素が折りたたまれます。これが私のコードです。よろしくお願いします。
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>