如何为html或css中的文本创建自定义下划线或突出显示? [英] How can I create custom underline or highlight for text in html or css?

查看:114
本文介绍了如何为html或css中的文本创建自定义下划线或突出显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何为文本创建自定义背景效果. 换句话说,我该如何做这样的事情:

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:

推荐答案

使用

Use the <mark> element and tweek the line-height

mark {
  display: inline-block;
  line-height: 0em;
  padding-bottom: 0.5em;
}

<h1><mark>Lorem ipsum</mark></h1>

这篇关于如何为html或css中的文本创建自定义下划线或突出显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆