html - How to put a min-height in a relative class css ? -
html - How to put a min-height in a relative class css ? -
i'm designing website, it's going 1 html page using javascript switch between divisions. i'm using wrap partition banner/header, text container , footer relative positioned. want footer @ to the lowest degree bottom of window when there not plenty content, i'm trying set min-height text container. website occupy @ to the lowest degree windows in it's height.
my html code (a part ^^)
    <div id="wrap">     <div id="banner"></div>     <div>         <div id="whoami" class="corpus"></div>         <div id="etc" class="corpus">there different divisions these, i'm switching through thoose using jquery, that's not  of import there. i'm trying  set min-height footer @ bottom of windows if there not  plenty content.  can't pass footer in absolute position</div>     </div>     <div id="footer"></div> </div>    the css goes this
html, body {     margin:0;     padding:0;     background:#fff;     height:100%; } #wrap {     background-color:#ff0;     min-height:100%;     width:1000px;     left:50%;     margin-left:-500px;     position:absolute; } #banner {     background-color:blue;     height:150px;     width:1000px;     position:relative; } .corpus {     width:800px;     min-height:100%; //i tried : min-height : calc(100% - 260px); didn't work.     margin-left:100px;     background-color:grey;     position:relative;     height:auto;     margin-top:5px; } #footer {     height:100px;     width:1000px;     background-color:purple;     position:relative;     z-index:1;     bottom:0;     margin-top:5px; }    a little fiddle road :http://jsfiddle.net/yoshino78/bn455/1/
i hope i've been clear ? ^^ help , if needed sense free inquire me details.
since #wrap positioned element , you've applied bottom:0 footer, you've apply position:absolute footer, it'll  remain @ bottom of #wrap regardless of content  within it.
side note: might want apply padding-bottom #wrap equal height of footer content won't hidden behind footer
 html css relative 
 
Comments
Post a Comment