PDA

View Full Version : center positioning



spyder
08-18-2005, 12:15 AM
i am making a site that is centerd in the browser. i usually use absolute positioning, but this doesnt work since it needs to be centered. i tried relative positioning, and used negative numbers to overlay a picture. this doesnt seem optimal, also because the browser continues to scroll down to the point where it should be. is there a diiferent slution that i am overlooking?
thank you

elliot
08-21-2005, 09:27 PM
Hi there.

GIve your content a wrapper div with the following:

#wrapper {
positioned: relative;
width: xxxxpx;
height: auto;
margin: 0px auto;
}

set the body to:

body {
text-align: center;
}

This works fine in all browsers,
hope it helps mate