Add 2 horizontal lines around title - HTML CSS HTML

HTML CSS examples for HTML:Line Break

Description

Add 2 horizontal lines around title

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
h2 {<!--  w w w. j ava2s .c  o  m-->
   width:100%;
   text-align:center;
   border-bottom:2px solid Chartreuse;
   border-top:2px solid yellow;
   line-height:0.2em;
   margin:11px 0 21px;
}

h2 span {
   background:blue;
   padding:0 11px;
}
</style> 
 </head> 
 <body> 
  <h2> <span>THIS IS A TEST</span> </h2> 
  <p>this is some content</p>  
 </body>
</html>

Related Tutorials