Force a container to fill the residual space

This question already has an answer here:

  • Make a div fill the height of the remaining screen space 31 answers

  • The easy way, because your header and footer have specific heights, is to do the following:

    // Add the following to #wrapper
    
    #wrapper {
      position: absolute;
      top: 200px;
      left: 0;
      right: 0;
      bottom: 200px;    
      // IMPORTANT
      // REMOVE the following rule:
      // min-height: 100%;      
    }
    

    Remember to remove the min-height: 100%; from #wrapper

    Here's a fiddle. Good luck...

    链接地址: http://www.djcxy.com/p/88250.html

    上一篇: 部分的动态高度

    下一篇: 强制一个容器填充剩余空间