Align-content and justify-content for flex - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align-content and justify-content for flex

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials