gpt4 book ai didi

html - 两个显示表格单元格之间的边距

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

我有以下 HTML 和 CSS

#one,
#two {
display: table-cell;
vertical-align: middle;
height: 47px;
background: red;
border-collapse: separate;
border-spacing: 10px;
}
<div>
<div id="one">one</div>
<div id="two">two</div>
</div>

demo

但无法如我所愿。我需要两个 div 之间的空间。如果我提供填充值,它会提供空间但不会删除背景。

最佳答案

您需要将 border-spacingborder-collapse 规则放在 parent div 上,而不是 table-cell div。

关于html - 两个显示表格单元格之间的边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17829723/

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