用绝对页脚重复背景图像

时间:2013-12-06 08:02:35

标签: html css background-image sticky-footer repeat

我正在尝试将重复图像作为我运行的博客的背景。

我无法显示页脚。

编辑:提供的代码有标题,重复图像和FOOTER。这是在背景图像中编码的最简单方法。

body {

   background:#1b0e11;    
   color:#170d23;    
   font:11px/18px arial, verdana, helvetica, sans serif;    
   margin:0px 0px 0px 0px;
   padding:0px;    
   background-image: url(http://i1331.photobucket.com/albums/w595/4V3D15/header_zpsf652d36b.png), url(http://i1331.photobucket.com/albums/w595/4V3D15/middle_zps8a8ab3d1.png), url(http://i1331.photobucket.com/albums/w595/4V3D15/footer2_zpsc6e75bc2.png);    
    background-repeat: no-repeat, repeat-y, no-repeat;    
   background-position: center top, center center, center bottom;  
     }

2 个答案:

答案 0 :(得分:0)

只需删除/评论即可:

// background-repeat: no-repeat, repeat-y, no-repeat;

不完全确定代码的页脚位置,你能提供一个小提琴吗?

答案 1 :(得分:0)

我没有看到您提供的代码存在问题。

我尝试使用你的背景来管理页脚。

HTML:

<div class="footer">Footer</div>

CSS:

body {
    background:#1b0e11;
    color:#170d23;
    font:11px/18px arial, verdana, helvetica, sans serif;
    margin:0px 0px 500px 0px;
    padding:0px;
    background-image: url(http://i1331.photobucket.com/albums/w595/4V3D15/header_zpsf652d36b.png), url(http://i1331.photobucket.com/albums/w595/4V3D15/middle_zps8a8ab3d1.png), url(http://i1331.photobucket.com/albums/w595/4V3D15/footer2_zpsc6e75bc2.png);
    background-repeat: no-repeat, repeat-y, no-repeat;
    background-position: center top, center center, center bottom;
}
.footer {
    width: 100%;
    height: 100px;
    outline: 1px solid;
    background: #eee;
    position: absolute;
    bottom: 0;
}

DEMO HERE