Fixed footer at the bottom of the page

Asked

Viewed 371 times

2

Well, I’ve searched a lot of sites how can I do this most of the time says it’s for me to

body, html{height:100%;}
footer{width:100%; bottom:0; position:absolute;}

But when I do it, it’s at the bottom of the screen, not at the bottom of the page.

That is, it stands in the middle and overlapping with the content.

Someone’s got to know how to fix it?

I am working as follows. It separates a file "Header.php", "Footer.php", and then I include it in the content file

<?php include "header.php"?>
//conteudo
...
<?php include "footer.php" ?>
  • Good afternoon, post the html structure, otherwise it is impossible to know what exactly caused the problem, try for now: footer{width:100%; bottom:0; position:absolute; z-index: 500;}.

1 answer

0

To fix to html is used pasition Fixed in case your code would be:

body {
    margin:0px; 
    padding:0px;
}

footer {
    width:100%; 
    position:fixed; 
    left 0px; 
    bottom:0px;
}

With this it stays fixed at the end of the screen.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.