Align 2 DIV per line, both the with the same height

前端 未结 4 1780
别那么骄傲
别那么骄傲 2021-01-26 20:40

We have a problem where we need to have a list of divs with dynamic content. There will always be 2 divs per row. Both of those elements should have the same height.

Cur

4条回答
  •  逝去的感伤
    2021-01-26 21:12

    Try this

    .boxes .box {
        float: left;
        margin-left: 2%;
        margin-bottom: 2%;
        width: 38%;
        padding: 4%;
        border: 1px solid #b6b6b6;
        border: 0.0625rem solid #b6b6b6;
        box-sizing: border-box;
        display:inline-block
    }
    .box-wrapper,.boxes{
            display:inline-block;
            width:100%;
    }
    

    Fiddle

提交回复
热议问题