I want to display a horizontal line with words in the middle so that it looks like following:
I'm trying this and doesn't work:
HTML:
<h2><span>Test</span></h2>
CSS:
h2{
font-size: 100px;
border-top: solid 1px black;
width: 100%;
height: 50px;
margin-top: 25px;
top: 50%;
z-index: 1;
}
span{
background: #fff;
padding: 0 20px;
margin-top:-25px;
display: inline-block;
z-index: 5;
}
JSFiddle: http://jsfiddle.net/2ds9a/