Place div to the top center of a page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Div Align

Description

Place div to the top center of a page

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
body {<!--from w w  w. j a va 2s. c o m-->
   margin:0;
   padding:0;
   background:Chartreuse;
}

#container {
   width:601px;
   height:601px;
   margin:6px auto 0 auto;
   background:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="container"></div>  
 </body>
</html>

Related Tutorials