HTML CSS examples for CSS Layout:Flex Column
Create Flex Box with 3 column and align to top
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .categories {<!--from ww w.j a v a 2 s .co m--> display:flex; flex-wrap:wrap; } .categories .category { width:34.34%; display:flex; flex-direction:column; } .category>ul { margin:0; box-sizing:border-box; } .red { background-color:Chartreuse; } .purple { background-color:yellow; } </style> </head> <body> <div class="categories"> <div class="category"> <ul class="purple"> <li> <span>Heading</span> <ul> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> </ul> </li> </ul> <ul class="red"> <li> <span>Heading 4</span> <ul> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> </ul> </li> </ul> </div> <div class="category"> <ul> <li> <span>Heading</span> <ul> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> </ul> </li> </ul> <ul> <li> <span>Heading</span> <ul> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> </ul> </li> </ul> </div> <div class="category"> <ul> <li> <span>Heading</span> <ul> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> <li>sub-heading</li> </ul> </li> </ul> </div> </div> </body> </html>