gpt4 book ai didi

html - 有没有办法让div成为线的高度

转载 作者:太空宇宙 更新时间:2023-11-04 13:46:41 25 4
gpt4 key购买 nike

我在同一行上有多个 div。 div 有宽度但没有明确的高度。他们从他们包含的文本数量中获得他们的高度。其中一个 div 的文本比其他的多很多,但我希望它们的高度都相同。

例如,在 this 中fiddle 我希望方框 1、2、3 和 5 的高度与方框 4 相同,而不添加任何其他元素或使用硬编码高度,它必须回到 IE8。这可能吗?

也许是这样的:

height: line-height; /* i know this isn't a real property */

enter image description here

最佳答案

display:inline-block 更改为 display: table-cell:

jsFiddle example

如果您需要调整单元格之间的间距,您可以将它们包裹在一个容器中并对其应用 border-spacing:

jsFiddle example

关于html - 有没有办法让div成为线的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26744145/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com