Create solid colored background using CSS - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Create solid colored background using CSS

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

.container {<!--from   www.  j a v  a  2 s.c  o  m-->
   background: rgba(0,0,255, 0.5);
   width: 100%;
   height: 300px;
}
.overlay {
   color: #FFF;
   padding: 20px;
}


      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="overlay">
     Hello World! 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials