gpt4 book ai didi

html - 如何在一段中设置行与行之间的边距?

转载 作者:太空宇宙 更新时间:2023-11-03 21:09:34 25 4
gpt4 key购买 nike

我需要在一段中设置行与行之间的边距。我该怎么做?我需要做这样的事情:

enter image description here

HTML:

<p>Any creative project is unique 
and should be provided with
the appropriate quality</p>

我试着把每一行都放在 <span> 中并设置 margin-bottom到它,但它不起作用。

最佳答案

只需将整个文本包装在 <span> 中即可标记并使用 line-height用于边距和 padding用于文本和背景之间的间距

堆栈片段

p {
font: bold 30px Verdana;
}

span {
background: red;
line-height: 45px;
color: #fff;
padding: 3px;
}
<p><span>Any creative project is unique and should be provided with the appropriate quality</span></p>

关于html - 如何在一段中设置行与行之间的边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48370138/

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