PDA

View Full Version : resoultion basic question



bambo
14 Nov 2006, 05:18 AM
Hi everyone,

I'm new here, and would like to know how to center my webpage so that it will be viewable on every resoultion starting 800 and upto 1024 (the webpage is designed as 800, while any resoultion higher than that will have blank spaces on the side)

I'm working with Visual Studio 2005.

hope you could help me on this...

Wickham
14 Nov 2006, 05:43 AM
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/tutorial/centeringdivs.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/tutorial/maxminwidth.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.