We can build is easily with these guaranties
- No images
- No extra
- HTML Scalable (that is, you could add larger text
and it automatically sizes to fit)
- Fluid
- No JavaScript
Method 1: A Pseudo-Element
h1:before {
content:"";
display: block;
border-top: solid 1px black;
width: 100%;
height: 1px;
position: absolute;
top: 50%;
z-index: 1;
}
h1 span {
background: #fff;
padding: 0 20px;
position: relative;
z-index: 5;
}
Demo: http://jsfiddle.net/7s79zwz5/
Method 2: Adjacent Sibling Selector
h1+p {
border-top: solid 1px black;
padding-top: 40px;
margin-top: -40px;
}
Demo: http://jsfiddle.net/v9g3d4ua/
Method 3: Linear Gradient
h1 {
background: -moz-linear-gradient(#ffffff 0%, #ffffff 49%, #000000 50%, #000000 51%, #ffffff 52%, #ffffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(49%, #ffffff), color-stop(50%, #000000), color-stop(51%, #000000), color-stop(52%, #ffffff), color-stop(100%, #ffffff));
background: -webkit-linear-gradient(#ffffff 0%, #ffffff 49%, #000000 50%, #000000 51%, #ffffff 52%, #ffffff 100%);
background: -o-linear-gradient(#ffffff 0%, #ffffff 49%, #000000 50%, #000000 51%, #ffffff 52%, #ffffff 100%);
background: linear-gradient(#ffffff 0%, #ffffff 49%, #000000 50%, #000000 51%, #ffffff 52%, #ffffff 100%);
}
Demo: http://jsfiddle.net/2m30vsgm/