Search code examples
csspositionheight

div not updating its 100% height when scrolling down page?


Ive got a div thats set to height:100%; and positioned used position:absolute it all works fine but when the content of the div causes it to go off the page and forces it to scroll, the div does not update its height.

Ive made a jsfiddle showing the problem http://jsfiddle.net/jw8Qc/3/


Solution

  • Set your height property to auto or try to use min-height: auto and it should works.

    Note: But with min-height property i'm not sure with its compatibility.


    Also here is i think problem with min-height in IE especially in IE 9.

    EDIT:

    .slide-out {
       position:absolute; 
       top:0; 
       left:155px; 
       width:375px; 
    }
    
    .slide-cont {
       background:#000;
       margin:20px;
       height: auto;
    }