Reputation: 2194
I'm trying to put a line over some text.
This is what I want
And this is what I got so far
this is the what I have in my application
<div class="zoekResultatLine">
<h2 class="zoekResultat">ZOEKRESULTAAT</h2>
</div>
.zoekResultatLine
{
text-decoration:overline;
color : rgb(217, 217, 217);
}
.zoekResultat
{
color : rgb(0, 158, 224);
}
Upvotes: 3
Views: 27576
Reputation: 2341
HTML:
<div class="zoekResultatLine">
<h2 class="zoekResultat">ZOEKRESULTAAT</h2>
</div>
CSS:
.zoekResultatLine{
display: block;
}
.zoekResultat{
color : rgb(0, 158, 224);
border-top: 1px solid #888;
}
Demo: http://jsfiddle.net/Smartik/ndbyc7dp/
Upvotes: 2
Reputation: 860
As others have said, you can use a <hr/>
element.
You can style these using CSS - see http://css-tricks.com/examples/hrs/
Upvotes: 0
Reputation: 15213
Give it a border-top
and play with the padding-top
to get it right:
.zoekResultatLine {
border-top:1px solid rgb(217, 217, 217);
}
.zoekResultat {
color : rgb(0, 158, 224);
margin-top: 0px;
}
Upvotes: 7
Reputation: 3684
This is kind of a workaround but you can make a div that functions as a line:
<div class="line"></div>
div.line
{
height: 1px;
width: 100%;
background-color: #000;
}
The advantage of this approach is that you can easily modify the line's width, height and colour, or even change the background to an image, add margins etc.
Upvotes: 2