html - 在页面底部显示图像

标签 html css

我想在页面底部显示一张图片(宽度为 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> 的后面(所以,可能不会覆盖)。我该如何解决它以及我做错了什么。谢谢

最佳答案

限定 ulheightwidth: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/

相关文章:

javascript - JQuery 不会在 Safari 以外的任何浏览器中加载

javascript - 展开右侧 float 的 div 以插入左侧的 div

javascript - 带有css和jquery的下拉菜单的滑动效果

jquery - 在选择列表之前插入标签

javascript - 位置 :fixed not working on mobile, 适用于桌面

javascript - 如何使用 angular js 正确显示 JSON 响应?

Javascript App Windows Universal - 脚本问题

html - CSS - 如何在圆形图像周围添加圆形边框/轮廓?

css - SCSS 符号使用错误

javascript - localstorage 不切换 View 并且在控制台中不产生任何错误