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

新手上路,请多包涵

所以我想尝试在 html 和 css 中做到这一点,但我似乎找不到任何东西。我唯一能想到的方法是将文本作为图像导入,但这看起来很糟糕。 PS 浅蓝色线用于居中,因为我首先在 Photoshop 中设计网站 我想在 html 和 css 中做什么

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

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

原文由 Cmi 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 173
1 个回答

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

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

原文由 RaminS 发布,翻译遵循 CC BY-SA 3.0 许可协议

推荐问题