Child div 100% height to parent auto height

后端 未结 7 882
忘了有多久
忘了有多久 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:49

    .parent{
        position: relative;
        width: 100px;
        height: auto;
    }
    .child{
        width: 50px;
        height: 100px;
        background-color: red;
    }
    .child_absolute{
        position: absolute;
        left: 50px;
        top: 0;
        bottom: 0;
        width: 50px;
        background-color: blue;
    }

提交回复
热议问题