Expand a div to fill the remaining width

前端 未结 21 1198
一生所求
一生所求 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 22:59

    Check this solution out

    .container {
      width: 100%;
      height: 200px;
      background-color: green;
    }
    .sidebar {
      float: left;
      width: 200px;
      height: 200px;
      background-color: yellow;
    }
    .content {
      background-color: red;
      height: 200px;
      width: auto;
      margin-left: 200px;
    }
    .item {
      width: 25%;
      background-color: blue;
      float: left;
      color: white;
    }
    .clearfix {
      clear: both;
    }
    25%
    25%
    25%
    25%

提交回复
热议问题