我有一个广泛的图像我想用作一个固定页脚。主页面是960px并居中,页脚是1620px。如果浏览器窗口宽度大于960像素,则会显示越来越多的页脚图像而不显示滚动条。CSS固定页脚宽度调整图像中心大小
我该如何做到这一点?到目前为止,我有这一点,但它是错误的:
CSS
* {
margin: 0;
}
html, body {
height: 100%;
}
div#wrapper {
position: relative;
width: 100%;
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -340px;
text-align: center;
}
div#body-container {
width: 960px;
margin-left: auto;
margin-right: auto;
}
.footer, .push {
width: 1620px;
height: 340px;
}
HTML
<div id="wrapper">
<div id="body-container"> <!-- width: 960px -->
<!-- content -->
</div>
<!-- fixed footer -->
<div class="push"></div>
<div class="footer"><img src="img/footer.png"></div> <!-- width: 1620px -->
</div>