Div with background color, semi opacity - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Div with background color, semi opacity

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

body<!--from w  w w. j  a v  a 2s . c  o m-->
{
   background-color: blue;
}
.thumb
{
   width: 40px;
   height: 40px;
   display: inline-block;
   margin: 10px;
   background-color: red;
}
.overlay
{
   height: 100%;
}
.thumb.framed .overlay
{
   border: 2px solid #fff;
   box-sizing: border-box;
}
.thumb.highlit .overlay
{
   background-color: rgba(255,255,255,0.4);
}


      </style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <td> 
      <div class="thumb"> 
       <div class="overlay"></div> 
      </div> </td> 
     <td> + </td> 
     <td> 
      <div class="highlit thumb"> 
       <div class="overlay"></div> 
      </div> </td> 
     <td> + </td> 
     <td> 
      <div class="framed thumb"> 
       <div class="overlay"></div> 
      </div> </td> 
     <td> = </td> 
     <td> 
      <div class="highlit framed thumb"> 
       <div class="overlay"></div> 
      </div> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials