gpt4 book ai didi

html - 如何将两种颜色应用于 header 标签的底部边框?

转载 作者:行者123 更新时间:2023-11-28 16:42:12 25 4
gpt4 key购买 nike

我有一个带有 CSS 的 h2 标签:

h2 {
display: inline-block;
border-bottom: 3px solid #ffcc00;
padding-bottom: 30px;
color: #5e5e5e;
font-size: 23px;
font-weight: 400;
line-height: 18px;
text-align: left;
margin: 30px 3px; }

看起来像这样:

[1]

但我想用不同的边框填充“其余宽度”。它必须看起来像这样:

enter image description here

最佳答案

HTML

<h2>
<span>Some header</span>
</h2>

CSS

h2 { 
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: lightgray;
}

span {
border-bottom-width: 3px;
border-bottom-style: solid;
border-bottom-color: orange;
padding: 30px 3px;
margin: 0 0 -2px 0;
display: inline-block;
}

演示:http://jsfiddle.net/neowar2x/3/

关于html - 如何将两种颜色应用于 header 标签的底部边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33582940/

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