css flexbox: same height for all elements?

前端 未结 4 832
慢半拍i
慢半拍i 2021-01-12 09:59

Using CSS and flexbox, I don\'t understand how to give the same height to divs \"a\" and \"b\". I need b to become taller so as to match a\'s height. In other words, the gre

4条回答
  •  被撕碎了的回忆
    2021-01-12 10:35

    If you can survive without flex, positioning can do this.

    #cont1{
    }
    
    #a{
        background-color:red;
        position: relative;
    }
    
    #b{
        background-color:grey;
        position: absolute;
        left: 0; top: 100%;
        width: 100%;
        height: 100%;
    }

    title

    title

    title title title title title title title title title

    short text

提交回复
热议问题