Mimic the table cell behaviour with divs - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Mimic the table cell behaviour with divs

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">
#container {<!--from   w  w w  .ja v  a  2  s.c  o  m-->
   overflow:hidden;
   width:100%;
}

#left-col {
   float:left;
   width:51%;
   background-color:Chartreuse;
   padding-bottom:501em;
   margin-bottom:-501em;
}

#right-col {
   float:left;
   width:51%;
   margin-right:-2px;
   border-left:2px solid yellow;
   background-color:blue;
   padding-bottom:501em;
   margin-bottom:-501em;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="left-col"> 
    <p>Lorem ip</p> 
    <p>Lorem ipsum dolor sit </p> 
   </div> 
   <div id="right-col"> 
    <p>Lorem ip</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials