Brock
Brock

Reputation: 161

CSS stick footer background to bottom of the page

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>

Footer is about 10 pixels before bootom. How I can add it to the very bottom of the page?

Upvotes: 1

Views: 371

Answers (1)

Lalji Tadhani
Lalji Tadhani

Reputation: 14169

add this css

body {
    margin:0;
}

Upvotes: 1

Related Questions