position div at absolute position - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

position div at absolute position

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!-- w w  w .java  2 s  . c  o m-->
 <body> 
  <div id="desk" style="position: absolute; width:400; height:400; background-color:blue;"> 
   <div id="cell1" style="position: absolute; left: 51px; top: 1px; width: 48px; height: 48px; color:black; background-color:black;"></div> 
   <div id="cell2" style="position: absolute; left: 1px; top: 51px; width: 48px; height: 48px; color:black; background-color:black;"></div> 
  </div>  
 </body>
</html>

Related Tutorials