Adding background to h1 for empty space - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:h1-h6

Description

Adding background to h1 for empty space

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">
.header {<!-- ww w  .j a va  2  s.co  m-->
   background:Chartreuse;
}

h1 {
   display:inline-block;
   background:yellow;
   margin:0;
   padding:0;
   padding-right:21px;
}
</style> 
 </head> 
 <body> 
  <div class="header"> 
   <h1>Title</h1> 
  </div>  
 </body>
</html>

Related Tutorials