gpt4 book ai didi

css - 下划线标题 - 较窄的线

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

我想创造这样的东西。
enter image description here

我真的很累,因为我只能创建与标题宽度相似的线。我必须创建“更小”的行然后标题。尝试用::before 完成它,但它对我不起作用。有没有可能的方法来创建它。

<h1>Some heading here</h1>

http://jsfiddle.net/53zxor2k/

最佳答案

h1 {
display: inline-block;
position: relative;
}
h1::after {
content: '';
position: absolute;
left: 10%;
display: inline-block;
height: 1em;
width: 70%;
border-bottom: 1px solid;
margin-top: 5px;
}

将宽度更改为您想要的长度,将“左侧”更改为线条所在的位置,并增加“margin-top”使其离文本更远。

http://jsfiddle.net/53zxor2k/1/

关于css - 下划线标题 - 较窄的线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28462913/

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