How to Add Horizontal Line On Sides of Text using CSS

How to Add Horizontal Line On Sides of Text using CSS

Here is the code to add Line of both the sides:

h2 { width:100%;text-align:center; border-bottom: 1px solid #000; line-height:0.1em; margin:10px 0 20px; } 
 h2 span { background:#fff; padding:0 10px; }
<h2><span>THIS IS A TEST</span></h2>
<p>this is some content</p>

Here is the code to add Horizontal Line on One side

h2 { width:100%; border-bottom: 1px solid #000; line-height:0.1em; margin:10px 0 20px; } 
 h2 span { background:#fff; padding:0 10px; }

No Comments

Leave a Reply