Position of divs with css - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Position of divs with css

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--  w w  w  .j  a  v a 2 s.  co m-->
 <body> 
  <div style="width: 100%; height:300px; position: relative;"> 
   <div id="header" style="float:right; height:300px; width: 60%; background-color: red;">
     Lorem 
   </div> 
  </div> 
  <div style="width: 100%;height:300px; position: relative;"> 
   <div id="main" style="float:left; height:300px; width: 40%; background-color: green;">
     Lorem 
   </div> 
  </div> 
  <div style="clear: both"></div>  
 </body>
</html>

Related Tutorials