Div height 100% excluding header

后端 未结 5 1033
半阙折子戏
半阙折子戏 2021-01-02 09:06

Ok so I know this topic has many questions, but I still haven\'t been able to figure exactly how to make this work. This is close to the problem, but its not working for m

5条回答
  •  执笔经年
    2021-01-02 09:59

    Use flex:1;

    html, body
    {
         height: 100%;
         margin: 0px;
    }
    
    #page
    {
        min-height: 100%;      
        display: flex;
      flex-direction: column;
    }
    
    #header
    {
    display: flex;
        height: 40px;
        background-color:red;
    } 
    
    #content
    {
        display: flex;
      flex: 1;    
      background-color:blue;
    }
    
         
    content

提交回复
热议问题