I’m using Twitter Bootstrap, Is there are any classes for footer? Because I can’t make it to stay on bottom. Here is my jsfiddle https://jsfiddle.net/fNPvf/18578/. This is footer css:
.footer-no-nav {
border-top: 1px solid #C2B8B8;
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
display: block;
}
Here is the picture when I use bootstrap class navbar-fixed-bottom
Here is when the window resized:
Fixed my problem, no need any navbar-fixed-bottom:
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-color: #f5f5f5;
}
5
Answers
I've just fixed my problem, no need any navbar-fixed-bottom:
Add
navbar-fixed-bottom
class to fixed it to the bottom like this:N.B. You will have to give a background-color to the footer div and add a
margin-bottom
equivalent to the height of the footer to prevent elements from being covered by the footer.This work for my webpage
try to add div for all your contain
and this is the link for your footer https://jsfiddle.net/fNPvf/18587/
Sounds like you are after a Sticky Footer.
Updated fiddle here: https://jsfiddle.net/fNPvf/18589/
The css relies on a removing the total height of the footer from the
margin-top
to make the footer stick to the bottom unless there is enough content to push it further. For a 40px height + 1px border-top footer this would calculate our margin-top to equal -41px.