No matter what I try (tutorials / posts on stackoverflow, w/e) I can’t make my footer to stay at the bottom of my website.
I’ve created this custom theme for WordPress (I didn’t post it on wordpress stackexchange, because this is rather a CSS question than a WP question). Anyways, this is my website:
http://plexus-orthopedie.nl/wordpress/?page_id=1941
I did not put any content in my footer or any CSS so if anyone wants to try CSS code, it’s easily possible.
The footer is located in:
html > body > div#page > footer.site-footer
Thanks in advance!
maybe add something like this to your css style.
I added a background-color to make it visible for now.
EDIT:
If you want the footer only to show on the bottom, not scrolling with you , add this instead of the above:
EDIT 2
I found the problem!
You have to change your div#content style.
Instead of
use this:
And change your style for #page .site-footer to this:
The problem was caused by the position:absolute in #content.
use one that trick:
OR
css
html
OK, after looking at your problem in a little more detail (im at work) i’ve found that you need to remove/add the following.
remove div id=”page”
remove div id=”content”
add the following css to div id=”primary”
add stuff to your footer, you’ll see it’s now working.
EDIT: css to header tag
How about:
to see your footer you need content of course… or add a fixed width and height and a background-color
I’ve just had this issue, or at least one similar, myself.
I found that I had an extra closing div tag inside of my .wpwrap
.wpfooter should be inside of .wpwrap in order to stick to it’s bottom (using pos: absolute & bottom 0 method)
The extra closing tag caused .wpwrap and .wpfooter to be siblings, so .wpfooter was positioned absolutely to body.
It’s worth just checking the html structure to see where .wpfooter is being rendered.
I hope that makes sense and hopefully helps somebody! 🙂
Don’t know why but this works for me:
if you are looking for a quick way around it use this
in your css add
#footer { top: 100vh; position:relative; width: 100%;}
in your html add
<div id="footer"><p>Hey look I was forced to be at the bottom</p></div>
I hope this helps but keep in mind that while designing a page the only thing that should never be set statically is the height!
the best way to do it is by setting a min-height at the div content or if you feel lazy at the container or even to the body tag! usually I do this to the body tag
min-height: 100vh
and this will keep the footer always at the bottom without having to worry about future pages!happy coding