26Nov
How to align page contents in center of browser window in Internet Explorer
Posted by admin as CSS
This quick fix will show you on how to align your page container in the center of the user’s browser window no matter what screen resolution your user may have. This fix is tested and will work on all browsers.
You have to have this css code in your css file:
body { text-align: center } #wrapper { width: 900px; //any width you want in your container margin: 0 auto; text-align: left; }
The “text-align: center” property of the body tag will align all the elements in the center. The “margin: 0 auto” property of the wrapper tag gives the wrapping element an automatic margin on both sides of our wrapper therefore centering our wrapping element together all its sub elements on the center of the browser window, whatever screen resolution the user may have.
And your HTML structure to wrap the contents of your webpage in a container:
<div id="wrapper"> // start your web content structure here... </div>



