【问题标题】:How to display mutiple underline color by css (instead of one color)如何通过css显示多个下划线颜色(而不是一种颜色)
【发布时间】:2022-07-05 17:29:56
【问题描述】:

我想为某个文本显示多个下划线颜色

I know that text-decoration-color is to set underline color. 

但我想拥有像下面这样的东西

【问题讨论】:

    标签: html css


    【解决方案1】:

    你可以用 span 包围文本并给它一个边框,如下所示:

    <span>happy than right<span>
    
    span {
        text-decoration: underline;
        text-decoration-color: red;
        border-bottom: 1px solid orange;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-24
      • 1970-01-01
      • 2019-04-10
      • 1970-01-01
      • 2014-12-03
      • 1970-01-01
      相关资源
      最近更新 更多