View Single Post
Old 08-15-2007   #11 (permalink)
notjustgraphics
Rusty Bio-Hazard!
 
notjustgraphics's Avatar
 
Join Date: Sep 2006
Location: Toronto, Ontario, Canada
Posts: 1,163

Send a message via MSN to notjustgraphics
I'll try to explain this in simple terms...

Absolute positioning is like defining co-ordinates on a map... if you define a top:10px and a left:10px in your css, the top left corner of that division will ALWAYS be placed at 10,10.

Relative positioning is 'relative' to the parent element... meaning that if you have divs inside of a div, they will be positioned relative to the parent...

If you are trying to get a Div to auto centre in a window at different sizes, you cannot use an absolute position... the div must be free to reposition itself in the centre of the screen as the window resizes.

I think what you need to do is take your entire site and change the positioning to relative. Then, add a parent div with a defined width (exactly the width of the site) ie: width:769px; and then declare margin:0 auto;

The margin:0 auto; will automatically centre tha parent div horizontally, and since the child divs (the rest of your site) are relative(ly) positioned, the whole site should be neatly stowed at mid-page regardless of window size (as long as the window is wider than the website).

Does this help?

Mike.
__________________
notjustgraphics is offline