Two floated divs with a flexible div in-between - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Container

Description

Two floated divs with a flexible div in-between

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  . j a  va2  s .c  o m-->
   border:1px solid #999;
}
#left {
   float:left;
}
#right {
   float:right;
}
h2 {
   text-align:center;
   margin:0;
}


      </style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="left">
     left 
   </div> 
   <div id="right">
     right 
   </div> 
   <h2>H2</h2> 
  </div>  
 </body>
</html>

Related Tutorials