Different column height in a row - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Different column height in a row

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

#main {<!--from   ww  w  .  jav  a  2 s.c om-->
   width: 280px;
   height: auto;
}
#left {
   width: 150px;
   float: left;
   height: auto;
}
#right {
   width: 100px;
   height: auto;
   margin-left: 30px;
   float: left;
}
.ac {
   height: 120px;
}
.a, .c {
   height: 50px;
   background-color: red;
}
.c {
   margin-top: 20px;
}
#second { 
   margin-top: 150px;
}
.b {
   height: 150px;
   background-color: #3F86CE;
}
#hidden {
   height: 150px;
   background-color: #fff;
   margin-top: 20px;
   visibility: hidden;
}


      </style> 
 </head> 
 <body> 
  <div id="main"> 
   <div id="left"> 
    <div class="ac"> 
     <div class="a"></div> 
     <div class="c"></div> 
    </div> 
    <div id="second" class="ac"> 
     <div class="a"></div> 
     <div class="c"></div> 
    </div> 
   </div> 
   <div id="right"> 
    <div class="b"></div> 
    <div id="hidden"></div> 
    <div class="b"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials