Z-index and Opacity on several nested divs - HTML CSS CSS Property

HTML CSS examples for CSS Property:opacity

Description

Z-index and Opacity on several nested divs

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">
.box {<!--from w  w  w . ja va 2 s  .com-->
   width:201px;
   height:201px;
}

.parent {
   background-color:Chartreuse;
   background-color:yellow;
}

.child {
   left:41px;
   top:41px;
   z-index:11;
   position:absolute;
   background-color:blue;
}

.child2 {
   background-color:pink;
   left:41px;
   top:41px;
   z-index:100;
   position:absolute;
}
</style> 
 </head> 
 <body> 
  <div class="parent box">
    Lorem ip 
   <div class="child box">
     Lorem i 
    <div class="child2 box">
      Lorem ipsum dol 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials