Display list item elements in different columns - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Display list item elements in different columns

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Stackoverflow - Display list item elements in different columns</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

* {<!--from ww  w . j a v  a2 s. c o  m-->
   padding: 0;
   margin: 0;
}
ul {
   list-style: none;
   padding: 0;
   font: 0/0 a;
}
ul li {
   display: inline-block;
   vertical-align: top;
   background-color: #DDD;
   margin: 5px;
   width: 200px;
}


      </style> 
 </head> 
 <body> 
  <ul> 
   <li>A</li> 
   <li> B <br> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem et ipsa dolores ab recusandae non molestiae tenetur aliquam natus molestias alias asperiores officia perspiciatis aut magni deserunt ullam eaque omnis. </li> 
   <li>C</li> 
   <li>D</li> 
   <li>E</li> 
   <li>F</li> 
   <li>G</li> 
   <li>H</li> 
  </ul>  
 </body>
</html>

Related Tutorials