How to make div occupy remaining height?

前端 未结 11 1072
遇见更好的自我
遇见更好的自我 2020-11-27 12:49

I have this problem, I have two divs:

<
11条回答
  •  温柔的废话
    2020-11-27 13:10

    Use absolute positioning:

    #div1{
        width: 100%;
        height: 50px;
        background-color:red;/*Development Only*/
    }
    #div2{
        width: 100%;
        position: absolute;
        top: 50px;
        bottom: 0;
        background-color:blue;/*Development Only*/
    }

提交回复
热议问题