Expand a div to fill the remaining width

前端 未结 21 1268
一生所求
一生所求 2020-11-21 22:21

I want a two-column div layout, where each one can have variable width e.g.

21条回答
  •  别跟我提以往
    2020-11-21 23:04

    Use the CSS Flexbox flex-grow property to achieve this.

    html, body {
      height: 100%;
    }
    body {
      display: flex;
    }
    .second {
      flex-grow: 1;
    }
    Tree
    View

提交回复
热议问题