2012-02-03 119 views
0

我想在页面底部显示图片(宽度为1px,高度为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>(所以,很可能没有覆盖)。我如何解决它,我做错了什么。由于

+0

当你说 '正后方',他们是里面是不是?只是一个想法。 – vascowhite 2012-02-03 15:50:09

+0

哦,是啊对不起,编辑:) – user893970 2012-02-03 15:51:05

回答

2

限定ulheightwidthfsFiddle 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; 
} 
+1

谢谢你,它部分工作,为可见的页面部分,而不是在底部。我的意思是,页面中有很多内容(向下滚动的东西)所以图像现在在理论上是在底部,但不完全:( – user893970 2012-02-03 16:11:34