Align cascaded div containers with Flexbox - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align cascaded div containers with 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">

* {<!--from  w w  w  . j  a va2s  . co  m-->
   box-sizing: border-box;
}
#nav, #left_side, #top_nav, #bottom_nav {
   display: flex;
}
#left_side {
   flex-direction: column;
   width: 100%;
}
#top_nav {
   justify-content: space-between;
}
#logo {
   width:100px;
   heigth:100px;
   background-color:black;
   margin-left:24px;
}


      </style> 
 </head> 
 <body> 
  <div id="nav"> 
   <div id="logo">
     100x100px Logo 
   </div> 
   <div id="left_side"> 
    <div id="top_nav"> 
     <div id="title">
       TITLE OF PAGE 
     </div> 
     <div id="menu_swith">
       SWITCH 
     </div> 
    </div> 
    <div id="bottom_nav"> 
     <div class="nav_item">
       Menu 1 
     </div> 
     <div class="nav_item">
       Menu 2 
     </div> 
     <div class="nav_item">
       Menu 3 
     </div> 
     <div class="nav_item">
       Menu 4 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials