I am having the classic problem for the positioning of a Footer on the bottom of the browser. I\'ve tried methods including http://ryanfait.com/resources/footer-stick-to-bot
If you use the "position:fixed; bottom:0;" your footer will always show at the bottom and will hide your content if the page is longer than the browser window.
This worked for me:
.footer
{
width: 100%;
bottom: 0;
clear: both;
}
The following css property will do it
position: fixed;
I hope this help.
#Footer {
position:fixed;
bottom:0;
}
That will make the footer stay at the bottom of the browser window no matter where you scroll.
For modern browser, you can use flex
layout to ensure the footer stays at the bottom no matter the content length (and the bottom won't hide the content if it is too long)
HTML Layout:
<div class="layout-wrapper">
<header>My header</header>
<section class="page-content">My Main page content</section>
<footer>My footer</footer>
</div>
CSS:
html, body {
min-height: 100vh;
width: 100%;
padding: 0;
margin: 0;
}
.layout-wrapper {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.layout-wrapper > .page-content {
background: cornflowerblue;
color: white;
padding: 20px;
}
.layout-wrapper > header, .layout-wrapper > footer {
background: #C0C0C0;
padding: 20px 0;
}
Demo: https://codepen.io/datvm/pen/vPWXOQ
#Footer {
position:fixed;
bottom:0;
width:100%;
}
worked for me