Align child elements of a flexbox container to opposite right ends of the main row - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align child elements of a flexbox container to opposite right ends of the main row

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-menu {<!--   www  .j  av  a  2 s.  c  o m-->
   width:100%;
   display:flex;
   flex-flow:row nowrap;
   justify-content:space-between;
   align-items:center;
   padding:0;
   margin:0;
   list-style:none;
}

li {
   margin:0 9px;
   padding:9px;
   font-size:2rem;
   text-align:center;
   font-weight:bold;
   color:Chartreuse;
   background:green;
   border:5px solid yellow;
}

#main {
   font-size:3rem;
}

#main span {
   font-size:2rem;
}

.right-menu {
   display:flex;
}
</style> 
 </head> 
 <body> 
  <ul class="parent-menu"> 
   <li id="main"> Some Logo <span>Some tag line.</span> </li> 
   <ul class="right-menu"> 
    <li>Home</li> 
    <li>Products</li> 
    <li>Price Sheet</li> 
    <li>Capabilities</li> 
    <li>Contact</li> 
   </ul> 
  </ul>  
 </body>
</html>

Related Tutorials