CSS fluid columns depending on content width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

CSS fluid columns depending on content width

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

.group {<!--   w  w  w  .j av a 2 s .c  o m-->
   display: table;width: 100%; table-layout: fixed;
}
.group > div {
   display: table-cell
}
.A {
   outline: 1px solid green;
   width: 100px;
}
.B {
   outline: 1px solid red;
   width: 30%;
}
.C {
   outline: 1px solid blue;
}


      </style> 
 </head> 
 <body> 
  <div class="group"> 
   <div class="A">
     Hi 
   </div> 
   <div class="B">
     Boo bar baz 
   </div> 
   <div class="C">
     text 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials