Child div 100% height to parent auto height

后端 未结 7 900
忘了有多久
忘了有多久 2021-02-12 19:47

Im here because other similar questions couldn\'t help my particular problem.

I need right div to be 100% height all the time, where the parent

7条回答
  •  忘了有多久
    2021-02-12 20:52

    You can accomplish this using flexbox and some creativity.

    .container {
      display: flex;
      background: black;
      padding: 5px;
      width: 300px
    }
    
    .left {
      height: 200px;
      flex: 1 0 0px;
      background: blue;
    }
    
    .right {
      flex: 1 0 0px;
      overflow: auto;
      background: green;
    }
    
    .column {
      display: flex;
      flex-direction: column;
      width: 20%;
    }

提交回复
热议问题