Add max and min height CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Height

Description

Add max and min height CSS

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">
#a {<!-- w w  w.  j  av  a2 s. c o  m-->
   width:100%;
   background-color:Chartreuse;
   padding:11px;
   position:relative;
   min-height:71px;
   max-height:100px;
}

#b {
   min-height:71%;
   max-height:100px;
   overflow:auto;
   position:absolute;
}
</style> 
 </head> 
 <body> 
  <div id="a"> 
   <div id="b">
     text text text text text text text text text text text text text text text 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials