Child div 100% height to parent auto height

后端 未结 7 1122
孤城傲影
孤城傲影 2021-02-12 19:50

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:36

    .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;
    }

提交回复
热议问题