Force absolutely-positioned elements to inherit transparency - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Force absolutely-positioned elements to inherit transparency

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 {<!--   w  w w. ja v  a 2 s.  c o  m-->
   width:100px;
   height:100px;
   border:2px solid Chartreuse;
   opacity:0;
   filter:alpha(opacity=0);
   position:relative;
}

#contained {
   position:absolute;
   border:3px solid yellow;
}

#contained div div p {
   position:absolute;
}
</style> 
  <script type="text/javascript">

      </script> 
 </head> 
 <body> 
  <div id="container"> 
   <p>Lorem ipsum d</p> 
   <div id="contained"> 
    <div> 
     <p>Lorem ipsum dolor sit amet, co</p> 
    </div> 
    <div> 
     <div> 
      <p>Lorem ipsum dolor sit amet, co</p> 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials