Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I guess you want to center a fixed width 'column' in the page containing your site's content? Try this :

1. Add the following into your CSS file
Code:
#content	{
	position: relative;
	left: 50%;
	margin-left: -300px;
	width: 600px}

2. Enclose all of your page content (ie all between <body> and </body>) with

Code:
<div id="content">
[i]your page content goes here[/i]
</div>

This will set all your content in a 600 pixel wide strip that centers in the browser window. To change the strip's width, adjust width as needed and always keep left margin so it satisfies:

Code:
left-margin = -0.5 * width

Hope this is what you want and that it works for you :)

There are other ways to achieve the same thing in CSS, but I am not familiar with them (yet) ;)
 
It's really best for you not to force a dimension on the user. The default screen to design for the web is still 800x600.

My previous example should work, if you set your width (ex: 600px) but use auto margins. Check out the stylesheet for this site (#all). I believe this is what you're looking for.
 
michaelrjohnson said:
It's really best for you not to force a dimension on the user. The default screen to design for the web is still 800x600.

My previous example should work, if you set your width (ex: 600px) but use auto margins. Check out the stylesheet for this site (#all). I believe this is what you're looking for.

That is the exact same result as with my method ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.