How to make div occupy remaining height?

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

I have this problem, I have two divs:

<
11条回答
  •  有刺的猬
    2020-11-27 13:13

    Why not use padding with negative margins? Something like this:

    And then

    .parent {
      padding-top: 1em;
    }
    .child1 {
      margin-top: -1em;
      height: 1em;
    }
    .child2 {
      margin-top: 0;
      height: 100%;
    }
    

提交回复
热议问题