Tell us what you're trying to accomplish. Don't ask how to do what you've decided is the solution. cheers, gary
place your content in a wrap-around div: css for wrapper div: #wrap { margin:0 auto; width:800px; } vanessa.
you need set the body and two div to make things works like charm...here's an example body{ margin:0 padding:0 text-align:center; } #div_wrap { margin:0 auto; //auto for left and right and 0 margin for top and left width:800px; //important to make the centered work } #div_container( marigin:0 float:left width:800px; ) so the html code should be like this <body> <div id="wrap"> <div id="container"> <!-- content here are all centered now --> </div> <div>//this one close the wrap </body>//this close the body try it out ..ok
Here is a solution with one div. Set the style for the div as follows... top: 50%; left: 50%; width: 800px; height: 400px; margin-left: -400px; margin-top: -200px; position: absolute; Setting this will put the div at the center of the page at all times.
Using absolute positioning to center an element is very fragile and lacks flexibility. Such a method does not allow for dynamic widths or heights. Should the browser viewport be smaller than the element, 50% of the overflow will be lost and unscrollable. cheers, gary