Make children divs the height of tallest child

前端 未结 3 770
情深已故
情深已故 2020-11-29 08:10

I have two child

elements inside of a parent container
as shown:

3条回答
  •  失恋的感觉
    2020-11-29 08:37

    One solution is to change the display value from inline-block to table-cell for the descendant div.item elements:

    .row {
        border: 1px solid red;
        display: table;
        border-spacing: 20px; /* For controlling spacing between cells... */
    }
    .item {
        background: rgba(0,0,0,0.1);
        display: table-cell;
    }
    

    Example

提交回复
热议问题