With HTML
/ CSS
, I need to get the footer
be placed on the bottom
of the page even if there is no enough content
.
In case there is a lot of content causing a scroll, is very easy to achieve this. The problem came up when there is not enough content because in that case, the footer goes up.
Here you have an image that could clarify this more:
I have the following starting code:
CSS
body {
margin: 0;
}
#header, #content, #footer {
padding: 10px;
}
#header {
height: 100px;
background-color: #abcdef;
}
#content {
bottom: 100px;
left: 0;
right: 0;
background-color: #F63;
overflow: auto;
}
#footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100px;
background-color: #abcdef;
}
HTML
<div id="header">
There is the Header
</div>
<div id="content">
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
hello world<br/>
</div>
<div id="footer">
There is the Footer
</div>
Jsfiddle preview: https://jsfiddle.net/bk5ow9us/ (try resizing the height of the window)
Any idea on how to achieve this?
IMPORTANT
I need a working solution also for IE (ver >= 11), not just FF and Chrome.