可能重复:
更改下划线颜色
只能更改文本下的线条颜色?我希望看到红色字母下面有一条蓝线,但是我找不到如何完成这件事.
我想在下划线可以是不同长度的地方加下划线。我还希望能够更改下划线的位置(在单词下方进一步向左或向右移动)。这似乎是一项非常简单的任务,但我无法让它发挥作用。
.underline {
border-bottom: 1px solid #5fca66;
padding-bottom: 5px;
}Run Code Online (Sandbox Code Playgroud)
This is a <span class="underline">sentence</span>. I would like some words to have longer <span class="underline">underlines</span> than others. I would also like to be able to change the <span class="underline">position</span> of the <span class="underline">underline</span>(to be centered under the word, for example).Run Code Online (Sandbox Code Playgroud)