Overflow one child within container while make others hidden - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Overflow

Description

Overflow one child within container while make others hidden

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>overflow hidden</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#parent {<!-- www .ja v  a  2 s. co m-->
   width:301px;
   height:301px;
   border:6px solid Chartreuse;
}

#innerParent {
   overflow:hidden;
   height:301px;
   border:none;
   float:left;
}

.child1 {
   width:51px;
   height:501px;
   background:red;
   float:left;
}

.child2 {
   width:51px;
   height:501px;
   background:blue;
   float:left;
}

.child3 {
   width:51px;
   height:501px;
   background:yellow;
   float:left;
}
</style> 
 </head> 
 <body> 
  <div id="parent"> 
   <div class="child1"> 
   </div> 
   <div id="innerParent"> 
    <div class="child2"> 
    </div> 
    <div class="child3"> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials