This content has been marked as final.
Show 1 reply
-
1. Re: Keeping my page centered in the browser
Cheryl D Wise Jul 17, 2009 5:03 PM (in response to BearHNC)Centering a page in a web browser requires the following:
- A valid doctype - Dreamewaver by default adds this to your pages.
- A container with a specified width - it can be in pixels, ems or percents
- The container must have margin-right: auto; margin-left: auto;
Example:
#container {
width: 775px; /* to fit in an 800px wide browser */
margin: 0 auto; /* no top or bottom margin and auto left-right */
}
<body>
<div id="container">
<!-- site code here -->
</div>
</body>


