How can I create custom underline or highlight for text in html or css?

前端 未结 4 1754
栀梦
栀梦 2021-02-10 14:09

I\'m trying to figure out how to create a custom background effect for text. In other words, how can I make something like this:

4条回答
  •  春和景丽
    2021-02-10 14:42

    A very good article explains a nice way to do that with gradients: https://thirtyeightvisuals.com/blog/low-highlight-heading-links-squarespace

    .highlight {
      background: linear-gradient(180deg,rgba(255,255,255,0) 50%, #FFD0AE 50%);
    }
    

提交回复
热议问题