html - 如何在html中的文本顶部放置一行?

标签 html css

所以我想尝试在 html 和 css 中执行此操作,但我似乎找不到任何东西。我唯一能想到的方法是将文本作为图像导入,但这看起来很糟糕。 P.S 浅蓝色线用于居中,因为我首先在 Photoshop 中设计网站 What I want to do in html and css

<p class="test">
Conact Me
</p>

.test {
border-top-style: solid;
border-bottom-style: solid;
border-bottom-width: 1px;
}

最佳答案

一个简单的解决方案是使用text-decoration: underline overline;

p {
  text-decoration: overline underline;
}
<p>
CONTACT ME
</p>

关于html - 如何在html中的文本顶部放置一行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45702245/

相关文章:

javascript - 同时使用 $ 和 jquery 作为变量

html - 如何使第一列的内容不溢出到CSS中的第二列?

html - Jekyll 博客文章标题相互堆叠

css - 我可以在 <div> 顶部添加图像而不添加任何 html 标签吗?

javascript - 在白色背景 div 下推送页脚

php - 在mysql数据库中将文本保存为pre

javascript - jQuery:明智地滚动div部分

html - 图片在我的 Bootstrap div 中没有正确放置

html - 有什么办法可以通过网页上的字符来改变文本 "halfway"的颜色吗?

javascript - 如何在 Github Pages 上托管我的 javascript Web 应用程序?