create the border height of a child div as same as the parent div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div Border

Description

create the border height of a child div as same as the parent div

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">

.parent {<!--from   w  ww.ja v a2  s  . c  om-->
   border: 2px solid black;
}
.child {
   width: 25%;
   overflow: hidden;
   border-right: 2px solid red;
}


      </style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="child"> 
    <h2>Content</h2> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials