SyntaxFix
Write A Post
Hire A Developer
Questions
This is because h1 is a block element, so it will extend across the line (or the width you give).
h1
You can make the border go only around the text by setting display:inline on the h1
display:inline
Example: http://jsfiddle.net/jonathon/XGRwy/1/