我想在页面底部显示一张图片(宽度为 1 px,高度为 200px)。但是,当我使用下面的代码时,我在页面上看不到任何新内容。
html:
<div id="makeThisBottom">
<ul class="xy">
</ul>
</div>
这是它的CSS:
ul.xy { width:auto; margin: 0; padding: 0; display:block; background:url(images/3006.png) repeat-x bottom left; }
#makeThisBottom{
position: absolute;
bottom: 0;
right: 0;
left: 0;
}
这个 div 和 ul 就在 </body>
的后面(所以,可能不会覆盖)。我该如何解决它以及我做错了什么。谢谢
最佳答案
限定 ul
的 height
和 width
:fsFiddle Demonstration
ul.xy {
width: auto;
margin: 0;
padding: 0;
display:block;
height: 200px;
background: url(images/3006.png) repeat-x;
}
#makeThisBottom {
position: absolute;
bottom: 0;
right: 0;
left: 0;
}
关于html - 在页面底部显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9131264/