gpt4 book ai didi

css - 使用css调整下划线和文本之间的距离

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

我想在文本和下划线之间添加一些空间。但是当我尝试在底部添加一些边框时,它占据了我分辨率的 100% 宽度。所以它看起来像这样:

enter image description here

这是我的CSS:

h1 { 
font-size: 24pt;
color: #279839;
position: relative;
text-decoration: none;
padding-bottom: 5px;
border-bottom: 1px solid #279839;
}

我的页面是多语言的,所以底部边框应该与文本宽度相同。

你能帮我解决这个问题吗?

最佳答案

文本下划线偏移

<h1 style="text-decoration:underline; text-underline-offset:.25em;">text</h1>

关于css - 使用css调整下划线和文本之间的距离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45582556/

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