html - Fluid height main body with header and footer -
html - Fluid height main body with header and footer -
what trying have header @ top of page , footer @ bottom, map total availiable space in-between. want header , footer have fixed heights px not %.
however, @ moment because set main map 100% forces footer off bottom of page , introduces scroll bar.
this illustration code: http://jsfiddle.net/w4mxp/20/
css
html, body { height: 100%; width: 100%; } #topbar { height: 50px; width: 100%; background-color: black; padding-left: 50px; padding-right: 50px; } #main { height: 100%; width: 100%; background-color: green; } #bottombar { height: 25px; width: 100%; background-color: black; padding-left: 50px; padding-right: 50px; } .left {float: left;} .right {float: right;}
html
<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> </head> <body> <!-- header --> <div id="topbar"> <div class="left"> logo </div> <div class="right"> <form> <div id="radio"> <input type="radio" id="radio1" name="radio" /><label for="radio1">choice 1</label> <input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">choice 2</label> <input type="radio" id="radio3" name="radio" /><label for="radio3">choice 3</label> </div> </form> </div> </div> <!-- map --> <div id="main"> map </div> <!-- footer --> <div id="bottombar"> <div class="left"> name </div> <div class="right"> </div> </div> </body> </html>
my reply here may help: set div block 100% height
simply set height of footer , negative margin on content:
#footer { height:100px; } #container { margin-bottom:-100px; padding-bottom:100px; }
here illustration of how you'd include footer: jsfiddle.
do note not work in ie7 due usage of box-sizing
.
edit: you'll need add together padding container prevent container text appearing under footer. i've fixed jsfiddle illustration include this.
html css web height
Comments
Post a Comment