.

CSS Display webpage div in center of screen

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>

What's your thoughts on this?

*

Protected by WP Anti Spam