I would define margins:
If I have a "div" that I want to center, I define its margins like this:
margin: 1em auto 2em auto;
This example gives me a space of 1em above, 2em below, and automatic margins that would center the div horizontally. If it's inside another div, it would be centered in the outer div.
You should define sizes of elements as "em"s or percent. NEVER use px -- it's still allowed, but it's oldfashioned and inflexible. If you use percent, you can have sizes of elements automatically adjusted according to the size of your window, and if you use ems all you have to do to change the size of all elements with "em" size is by adjusting the font-size of "body".
For an example, check out my side
http://upandforward.com , and adjust the width of the browser window. Text and image sizes will follow. There are no restrictions for looking at the html code if you want to, but the original php code will normally not be available.
I had another site which might be a better example because it did something like you are looking for, but it broke a stupid law. I was simply not allowed to tell the truth, and I'm just an old fool who still prefers the truth beats anything else.