Javascript 多行,不同高度-均衡每行(JS)

Javascript 多行,不同高度-均衡每行(JS),javascript,css,Javascript,Css,我有不同的行,其中有4个div。 请查看以下代码段: <div class="w-row"> <div class="w-col w-col-3"> <!-- lets assume this image has a height of 30px --> <img src="myimage.png"> </div> <div class="w-col w-col-3">

我有不同的行,其中有4个div。 请查看以下代码段:

<div class="w-row">
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 30px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 40px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 20px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 60px -->
        <img src="myimage.png">
    </div>
</div>

<div class="w-row">
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 20px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 40px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 20px -->
        <img src="myimage.png">
    </div>
    <div class="w-col w-col-3">
        <!-- lets assume this image has a height of 30px -->
        <img src="myimage.png">
    </div>
</div>
如果我这样使用它:

equalizeHeight("w-row w-col-3") // this would lead to having all columns to have the highest image-height of all elements on the page
equalizeHeight("w-row w-row1"), I'd have to call this function `n` times, without knowing how many times it has to be called. 
有人有想法/解决方案吗

//更新1

链接到CSS文件
最干净的解决方案是使用
弹性盒
。它将平衡所有的高度,而无需“平铺”立柱

.flex行{
显示:-webkit flex;
显示:-ms flexbox;
显示器:flex;
-webkit柔性包装:包装;
-ms-flex-wrap:wrap;
柔性包装:包装;
}
.flex col{
填充物:5px;
显示:-webkit flex;
显示:-ms flexbox;
显示器:flex;
}
p{
背景色:黑色;
颜色:#fafafa;
填充:5px
}

知识是一种美德,是一种美德,是一种美德,是一种美德。但是,在最低限度上,我们需要一个实验室来进行日常工作

知识是一种美德,是一种美德,是一种美德,是一种美德。但是,在最低限度上,我们需要一个实验室来进行日常工作。两人或两人在一个无教区的房间里互相指责

知识产权是一种权利,是一种权利,是一种权利,是一种权利

知识是一种美德,是一种美德,是一种美德,是一种美德。但是,在最低限度上,我们需要一个实验室来进行日常工作。两人或两人在一个无教区的房间里互相指责。除非圣奥会因疏忽而死亡,否则必须承担责任


您可以共享CSS吗?也许你可以使用表格单元格或flexboxCSS@DaniP在粘贴箱中添加了webflow.css。您可以使用flexbox吗?另外,请在你的帖子中加入相关的CSS。谢谢