Set div height equal to screen size

后端 未结 6 1620
情深已故
情深已故 2020-11-30 02:10

I have a div element in twitter-bootstrap which will have content that will overflow vertically outside the screen.

I would like the div to take the height of the si

6条回答
  •  甜味超标
    2020-11-30 02:57

    You need to give height for the parent element too! Check out this fiddle.

    CSS:

    html, body {height: 100%;}
    
    #content, .container-fluid, .span9
    {
        border: 1px solid #000;
        overflow-y:auto;
        height:100%;
    }​
    

    JavaScript (using jQuery) Way:

    $(document).ready(function(){
        $(window).resize(function(){
            $(".fullheight").height($(document).height());
        });
    });
    

提交回复
热议问题