html - Need div to fill gap between two divs -


given following html:

<div id="wrapper"> <div id="header">*header*</div> <div id="content">*content*</div> <div id="footer">*footer*</div> </div> 

and following css:

#wrapper { min-height:100%; position:relative; } * {margin:0;padding:0;height:100%;} #header {     width:100%;     height:auto;     margin-top: 0; } #content {     width:100%;     height: auto;     margin:0;     margin-top:0;     margin-bottom:0; } #footer {     width:100%;     height:auto;     position:absolute;     margin-top: 0;     margin-bottom: 0;     bottom:0;     left:0; } 

there gap between content , footer's div. how can set content's height must space between header , footer?

the footer has have 'absolute' position position @ bottom of page.

try using display:table, table-row options

display:table #wrapper

display:table-row #header, #content (width , height should 100% here) , #footer

#wrapper {     min-height:100%;     position:relative;      display: table;      width:100% }  #header {     width:100%;     height:auto;     margin-top: 0;     background:#dbfcd6; display: table-row; } #content {     width:100%; display:table-row; background:green; height:100% } #footer {     width:100%;     height:auto;     position:absolute;     margin-top: 0;     margin-bottom: 0;     bottom:0;     left:0; background:yellow;     display: table-row; } 

demo


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -