Align items using flex - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align items using 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">
.parent {<!--from  ww w. ja v a  2  s. c om-->
   display:flex;
   justify-content:center;
}

.box {
   width:201px;
   height:201px;
   background:Chartreuse;
   margin:21px
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="child child--left"> 
    <div class="box"></div> 
   </div> 
   <div class="child child--right"> 
    <div class="box"></div> 
   </div> 
   <div class="child child--right"> 
    <div class="box"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials