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 个像素。如何将它添加到页面的最底部?
最佳答案
添加这个CSS
body {
margin:0;
}
关于html - CSS将页脚背景粘贴到页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34766888/