文本下方的水平 html 线

Horizontal html line underneath text

我想在 html 中制作一条水平线,它位于单词下方。像这样:

示例
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯

我该怎么做?

您可以使用文字修饰。

p.sometext {
    text-decoration:underline;
}

或者你可以试试边框。

div.sometext {
    border-bottom:solid 1px #DDD;
}

听起来您只是要求在 header 下方放置一条水平线。如果是这样,请使用 <hr> 元素。

示例:

<h1>This is a heading</h1><hr>