I am attempting to enforce that my footer goes at the bottom of my website. I do not want it to stick when I scroll, just to appear at the bottom when scrolling down the webpage.
Currently - the webpage displays with the footer sitting beneath the content.
I have added such code as bottom:0;
and found that it sticks and does not suit my website. I have also added such code as html, body { height:100%;}
as viewed on other stackoverflow questions - but have had no joy.
Any advice would be appreciated.
Code:
.footer {
background: #F37A1D;
position : absolute;
width: 100%;
border-top: 3px solid #F37A1D;
}
<div class="footer">
<div class="container">
<p>© COMPAY 2015</p>
</div>
</div>
*{
padding: 0;
margin: 0;
}
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background: #F37A1D;
border-top: 3px solid #F37A1D;
}
<div class="footer">
<div class="container">
<p>© COMPAY 2015</p>
</div>
</div>
You can just add navbar-fixed-bottom
class to the footer.
<footer class="navbar-fixed-bottom">
<p>Footer content</p>
</footer>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="jumbotron">
<h1>Twitter Bootstrap 3.0</h1>
</div>
<footer class="navbar-fixed-bottom">
<p>Footer content</p>
</footer>
</div>
You may also want to refer to Bootstrap sticky footer CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With