Line Behind Text
by ashleycam3ron
HTML
<h2>Strikethrough title</h2>
<h2><span>Line-behind title</span></h2>
<h2 class="double"><span>Double-lined title</span></h2>
CSS
body {
background: white;
}
h2 {
font: 18px sans-serif;
margin-top: 30px;
position: relative;
text-align: center;
text-transform: uppercase;
z-index: 1;
color: #565656;
letter-spacing: .07em;
}
h2:before {
border-top: 1px solid #dfdfdf;
content: "";
margin: 0 auto;
position: absolute;
top: 10px;
left: 0;
right: 0;
bottom: 0;
width: 95%;
z-index: -1;
}
h2 span {
background: #fff;
padding: 0 10px;
}
h2.double:before {
border-top: none;
}
h2.double:after {
border-bottom: 1px solid yellow;
-webkit-box-shadow: 0 1px 0 0 orange;
-moz-box-shadow: 0 1px 0 0 orange;
box-shadow: 0 1px 0 0 orange;
content: "";
margin: 0 auto;
position: absolute;
top: 45%;
left: 0;
right: 0;
width: 95%;
z-index: -1;
}