I'm attempting to make my main content and menu divs extend up to the bottom of the footer div. Here's my HTML:
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
#wrapper {
min-height: 100%;
position: relative;
}
#header {
padding: 10px;
background: #3095C7;
}
#main {
padding-bottom: 80px;
bull
}
#content {
padding-left: 310px;
background: #FFEFC4;
}
#menu {
background: #67b5d1;
width: 300px;
position: absolute;
float: left;
}
#footer {
text-align: center;
padding: 30px 0;
width: 100%;
height: 50px;
position: absolute;
bottom: 0;
left: 0;
background: #3095C7;
}
<div id="wrapper">
<div id="header"></div>
<div id="main">
<div id="menu">
menu here
</div>
<div id="content">
content here
</div>
</div>
<div id="footer">footer content</div>
</div>
I've set the main
, content
, and menu
heights to 100%, but they only reach the very bottom of the wrapper
div, extending beyond the footer
. What I want is for the menu and content to span from the header down to the top of the footer, filling the entire page. I've experimented with using vh
units, but it isn't always accurate when resizing the window.
Are there any tricks to ensure the divs fill all available space without overlapping the footer?