CSS粘贴页脚背景到页面底部

时间:2016-01-13 12:34:11

标签: html css

CSS:

.footer {
 background-image: url("./images/footer.png");
 height: 45px;
 background-position: center center;
 background-repeat: no-repeat;
 position: relative;
 bottom: 0;
 }

HTML

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>My title</title>
 </head>
<body>
  .. some header divs..
  .. some content divs..
 <div class="footer">FOOTER</div>
</body>
</html>

页脚在bootom之前约为10个像素。我如何将它添加到页面的最底部?

1 个答案:

答案 0 :(得分:1)

添加此css

body {
    margin:0;
}