Float div to left and right with 100% height and fixed width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Float

Description

Float div to left and right with 100% height and fixed width

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">
html, body {
   height:100%;
}

#left {
   float:left;
   width:301px;
   background:red;
   height:100%;
}

#right {
   float:right;
   background:green;
   height:100%;
}
</style> <!--from w  w  w.  java2  s  . co m-->
 </head> 
 <body> 
  <div id="left">
    few contents here 
  </div> 
  <div id="right">
    more contents here 
  </div>  
 </body>
</html>

Related Tutorials