Make 2 stacked divs next to 1 div with fixed size - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Make 2 stacked divs next to 1 div with fixed size

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">
#blue {<!--from  w  w w. j ava 2s . co  m-->
   width:100px;
   height:100px;
   background:blue;
   float:left;
   position:relative;
}

#red {
   width:100px;
   height:51px;
   background:red;
   float:right;
}

#green {
   width:100px;
   height:51px;
   background:green;
   float:right;
   clear:right;
}
</style> 
 </head> 
 <body> 
  <div id="blue">
    one 
  </div> 
  <div id="red">
    two 
  </div> 
  <br> 
  <div id="green">
    three 
  </div>  
 </body>
</html>

Related Tutorials