无法解决在 ie7 中为 DOM 元素提供 z-index 的解决方案。好的,这是真正的标记:
<div id="page-wrap">
<div class="push"></div>
<footer id="footer-container" class="source-org vcard copyright">
<div class="grass"></div>
<div id="footer"></div>
</footer>
这里的CSS:
#page-wrap {
height: auto !important;
margin: 0 auto -60px;
min-height: 100%;
position: relative;
width: 98%;
}
.push {
height: 60px;
}
#footer-container {
background-color: #1B1B1B;
bottom: 0;
height: 60px;
position: relative;
width: 100%;
}
.grass {
background-image: url("assets/images/grass.png");
background-repeat: repeat-x;
height: 82px;
position: absolute;
top: -78px;
width: 100%;
}
article, aside, figure, footer, header, hgroup, nav, section {
display: block;
}
#footer {
margin: auto;
position: relative;
top: 20px;
width: 960px;
}
希望能帮助到你。实际上,这在所有浏览器上都可以正常工作,即使是 ie9 和 ie8。