Div inside another Div positioned relatively and overflow - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Div inside another Div positioned relatively and overflow

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">
.out {<!--from   w  w  w  .  j ava2 s. c  o  m-->
   margin-left:100px;
   width:131px;
   height:131px;
   margin-top:11px;
   border:2px solid Chartreuse;
   position:relative;
   overflow:hidden;
}

.in {
   width:100%;
   height:100%;
   z-index:1000;
   clear:both;
   position:absolute;
   background-color:yellow;
}
</style> 
 </head> 
 <body> 
  <div class="out"> 
   <div class="in"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials