Set display:table-cell and set height and overflow:hidden - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Set display:table-cell and set height and overflow:hidden

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">
.table {<!--   ww  w  .j a v  a2  s . c  om-->
   display:table;
   table-layout:fixed;
   width:100%;
   height:201px;
}

.cell {
   display:table-cell;
   vertical-align:top;
   position:relative;
   height:201px;
   overflow:hidden;
}

.container {
   height:100px;
   background-color:Chartreuse;
}

.container img {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div class="table"> 
   <div class="cell"> 
    <div class="container"> 
     <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
     <img src="https://www.java2s.com/style/demo/Safari.png"> 
     <img src="https://www.java2s.com/style/demo/Safari.png"> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials