Centering without a limit is simpler than centering with a maximum.
Centering without a limit uses one of two methods:-
See http://www.wickham43.supanet.com/tut...eringdivs.html
items 2 and 3.
Item 2 is the best (your containing div must have a width, which you say it has, but must not be position: absolute, then just add margin: auto; ).
Item 3 works if your div is position: absolute; but has a disadvantage if the viewer uses a window less wide than your div.
Centering with a max (and a min) can be achieved using the Jellomold hack which was designed for IE6 but works in IE7 and Firefox too.
IE7 and Firefox can use just max-width: 1024px; but then you won't get it to work in IE6 so it may be worth using the hack for all browsers. See
http://www.wickham43.supanet.com/tut...xminwidth.html item 1.
----------edit
The Jellomold max/min method needs all your divs to be flexible (ie have no stated width). If your webpage is set up with a fixed width, as it seems to be, you can only use one of the first two methods. Your page will always show 800px wide and the space either side will vary.
Note that it is often better to make a page 780px wide so that there is room for a vertical scrollbar for viewers using a window 800*600. This should mean that there will not be a horizontal scrollbar.
Last edited by Wickham; 14 Nov 2006 at 06:20 AM.
Code downloaded to my PC will be deleted in due course.
WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.