CSS: How to center text with surrounding borders
I am trying to center text that has a line going through the entire background. On either side of the text, there is some padding, where you cannot see the line at all. I am stumped as far as a good css-only way to go about this. Here is a jsfiddle that is obviously wrong, but its a start: http://jsfiddle.net/gtspk/ HTML <span class="line"> <h2>Latest Track</h2> </span> CSS .line{display:block; width:100%; border-bottom:1px solid red; margin-top:25px; text-align:center} .line h2{font-size:15px; text-align:center; position:relative; top:10px; padding:0 15px; display:inline-block; background