Html 文本和下划线之间的空格

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3085394/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 03:33:01  来源:igfitidea点击:

space between text and underline

htmlcssunderline

提问by Kali Charan Rajput

i am using text-decoration:underline;but text and underline are touching each other.can i increase space between text and underline?

我正在使用text-decoration:underline;但文本和下划线相互接触。我可以增加文本和下划线之间的空间吗?

alt textthis one. i want to make space between text and underline.

替代文字这个。我想在文本和下划线之间留出空间。

回答by BalusC

Either use a different font or use a border-bottominstead so that you can control the space with padding-bottom.

要么使用不同的字体,要么border-bottom改用 ,以便您可以使用 控制空间padding-bottom

回答by Mandeep Gill

I had same issue then i used :

我有同样的问题,然后我使用:

.underline_text {
      border-bottom: solid 2px #000000;
      display: inline;
      padding-bottom: 3px;
}