gpt4 book ai didi

css - {CSS} "text-decoration: line-through"在文本上绘制的线条的不同颜色?

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

是否可以更改换行文字的线条颜色?我的意思是,例如,黑色文本和红色线条!?

enter image description here

最佳答案

您可以像这样使用一些 CSS 技巧:

    .line-through-text {
position: relative;
color: blue;
}

.line-through-text:before {
border-bottom: 2px solid orange;
position: absolute;
content: "";
width: 100%;
height: 50%;
}
<h2>
Hello There! <span class="line-through-text">This is wrong,</span> This is correct
</h2>

关于css - {CSS} "text-decoration: line-through"在文本上绘制的线条的不同颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36681542/

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