Creating headers with horizontal line across - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Creating headers with horizontal line across

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>

h1 {<!--  w w  w  .java  2s .com-->
   position: relative;
   text-align: center;
   font-size: 1em;
}
h1:before {
   position: absolute;
   content: '';
   height: 2px;
   background: #F00;
   display: block;
   width: 100%;
   top: 0.6em;
   z-index: -1;
}

      </style> 
 </head> 
 <body> 
  <h1>Heading</h1>  
 </body>
</html>

Related Tutorials