HTML CSS examples for CSS Layout:Column Layout
Making column layout with flows in order
<html> <head> <title>Pure CSS masonry layout</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #container {<!-- w ww . j ava 2 s.com--> width: 100%; max-width: 700px; margin: 2em auto; position:relative; } .cols { -moz-column-count:3; -moz-column-gap: 3%; -moz-column-width: 30%; -webkit-column-count:3; -webkit-column-gap: 3%; -webkit-column-width: 30%; column-count: 3; column-gap: 3%; column-width: 30%; } .box { margin-bottom: 20px; display:inline-block; list-style:none; width:100%; } .box.one { height: 200px; background-color: #d77575; } .box.two { height: 300px; background-color: #dcbc4c; } .box.three { background-color: #a3ca3b; height: 400px; } .box.four { background-color: #3daee3; height: 500px; } .box.five { background-color: #bb8ed8; height: 600px; } .box.six { background-color: #baafb1; height: 200px; } </style> </head> <body> <div id="container" class="cols"> <li class="box one"></li> <li class="box two"></li> <li class="box one"></li> <li class="box three"></li> <li class="box two"></li> <li class="box five"></li> <li class="box one"></li> <li class="box two"></li> <li class="box six"></li> <li class="box three"></li> <li class="box two"></li> </div> </body> </html>