CSS Display webpage div in center of screen

by pietman 12. November 2009 10:38

Here follows the minimum code you need to display your website in the middle of the screen:
(notice the importance of the "margin: auto" and "width: ___px" properties)

#main_div {
 margin: 0 auto;
 width: 200px;
}


Html:

<body>

 <div id="main_div">
  <p>My Page</p>
 </div>

</body>

Tags: ,

CSS

Add c0mment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About ...

pietman celliersPietman Celliers
Bitlink  Ltd
bitlinkit.com