Column layout with dynamic number of columns - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Column layout with dynamic number of columns

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Flexbox for Columns</title> 
  <style>

.album {<!-- w w w .  j  a v a2  s. c  o  m-->
   background: #faa;
   padding: 5px;
   height: 480px;
   display: -webkit-inline-flex;
   display: inline-flex;
   -webkit-flex-flow: column wrap;
   flex-flow: column wrap;
   -webkit-align-items: flex-start;
   align-items: flex-start;
}
.album img {
   margin: 5px;
}


      </style> 
 </head> 
 <body translate="no"> 
  <div class="album"> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
   <img src="https://www.java2s.com/style/demo/Safari.png"> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  </div>  
 </body>
</html>

Related Tutorials