Align div element right using flexbox - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align div element right using flexbox

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">
.wrap {<!--   w ww  .  j a  v a 2  s.  c om-->
   display:flex;
   background:Chartreuse;
   justify-content:space-between;
}
</style> 
 </head> 
 <body> 
  <div class="wrap"> 
   <div> 
    <span>One</span> 
    <span>Two</span> 
   </div> 
   <div>
     Three 
   </div> 
  </div> 
  <br> 
  <div class="wrap"> 
   <div> 
    <span>One</span> 
    <span>Two</span> 
   </div> 
   <div> 
    <span>Three</span> 
    <span>four</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials