1
我有不同的行,其中有4個div。 看一看下面的代碼片段:多行,不同高度 - 均衡每行(JS)
<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>
我想diffrently均衡的每一行,使我第w-row
,用類w-col w-col3
容器應該得到它的元素的最大高度的高度。在我的例子中,w行中的前4個div應該每個都有60px的高度。
第二屆4個格應該得到的40像素
的高度通常我使用了一個均衡器功能,但內容是動態呈現,所以有n
元素和行,所以我不能只是數字他們通過,因爲我必須使用均衡器是這樣的:如果我使用它是這樣的
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文件 webflow.css
可以共享CSS?也許你可以在CSS上使用table-cell或flexbox – DaniP
@DaniP在pastebin中添加了webflow.css。 – DasSaffe
你可以使用flexbox嗎?另外,請在**你的帖子中包含**相關的** CSS **。謝謝。 – hungerstar