html - 在文字上方加一行

标签 html css

我正在尝试在一些文本上划线。

这就是我想要的enter image description here

这就是我到目前为止所得到的

enter image description here

这是我的应用程序中的内容

<div class="zoekResultatLine">
    <h2 class="zoekResultat">ZOEKRESULTAAT</h2> 
</div>


.zoekResultatLine
{     
     text-decoration:overline;
     color : rgb(217, 217, 217);
}

.zoekResultat
{
    color : rgb(0, 158, 224);
}

最佳答案

给它一个 border-top 并使用 padding-top 让它正确:

.zoekResultatLine {
    border-top:1px solid rgb(217, 217, 217);
}
.zoekResultat {
    color : rgb(0, 158, 224);
    margin-top: 0px;
}

Fiddle

关于html - 在文字上方加一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25308999/

相关文章:

html - <text> 和 <span> 的区别

javascript - 滚动 safari bug 上元素的增长高度

html - 带有固定侧边栏的 100% 高度列

html - 同一行上的不同文本样式

javascript - Bootstrap 3.3.7 - Bootstrap 的 CDN (maxcdn) 支持会结束吗?我是否会被迫迁移到 Bootstrap 4?

css - 设置不同高度的div?

html - 在编写响应式设计时,对同一页面元素使用多个标记是否被认为是可接受的做法?

css @font-face 根本不起作用

css - 两个div并排,右侧div固定宽度

php - 更改表中行的颜色