HTML CSS examples for CSS Layout:Flex Wrap
Wrap Flex items
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #maindiv {<!--from www . ja va 2 s.c o m--> margin:auto; width:98%; border:2px solid Chartreuse; border-radius:3px; margin-top:11px; -webkit-justify-content:space-around; -webkit-flex-wrap:wrap; -moz-justify-content:space-around; -moz-flex-wrap:wrap; -ms-justify-content:space-around; -ms-flex-wrap:wrap; justify-content:space-around; flex-wrap:wrap; display:-webkit-flex; display:-moz-box; display:flex; -moz-box-pack:center; -moz-box-align:center; height:396px; max-height:396px; overflow-y:scroll; } #maindiv div { width:100px; height:100px; background:blue; margin:11px; } </style> </head> <body> <div id="maindiv"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> </body> </html>