HTML CSS examples for CSS Layout:Flex Align
Align-content and justify-content for flex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #container {<!--from w ww . ja v a2 s. c o m--> display:flex; flex-wrap:wrap; justify-content:center; align-content:center; height:91vh; } #header { flex:0 0 201px; background-color:Chartreuse; height:201px; border-radius:2rem; } #main { flex:0 0 201px; background-color:yellow; height:201px; border-radius:2rem; } #footer { flex:0 0 201px; background-color:blue; height:201px; border-radius:2rem; } @media screen and (max-width: 915px) { #container { flex-flow:column wrap-reverse; } } </style> </head> <body> <div id="container"> <div id="header"> Header </div> <div id="main"> Main </div> <div id="footer"> Footer </div> </div> </body> </html>