Text layout in three columns - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:3 Column

Description

Text layout in three columns

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style>

.col-container {<!--from www.  jav  a  2  s .  c o m-->
   display: table;
   width: 100%;
}
.col {
   display: table-cell;
}
p{
   margin-left:10px;
}

      </style> 
 </head> 
 <body> 
  <h2>Equal Height Columns</h2> 
  <p>Make the columns match the height of the tallest column.</p> 
  <div class="col-container"> 
   <div class="col" style="background:orange"> 
    <p>Top Aligned - this text should be at the top of the cell</p> 
   </div> 
   <div class="col" style="background:yellow"> 
    <p>Para pushes previous cell content down</p> 
   </div> 
   <div class="col" style="background:orange"> 
    <p>Column top aligned </p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials