Background color with height shows on full page - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Background color with height shows on full page

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">

#bg {<!--from   w  w  w  .  java2  s .  com-->
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 500px;
   background-color: #08407A;
   z-index: 1;
}
#wrapper {
   position: relative;
   z-index: 2;
}


      </style> 
 </head> 
 <body> 
  <div id="bg"></div> 
  <div id="wrapper"> 
   <h1>Hello World</h1> 
  </div>  
 </body>
</html>

Related Tutorials