Several points:
Height can't see the browser window size in most browsers.
Most browsers correctly put the surrounding styles (margin, border, padding) OUTSIDE the size styles (width, height). Internet Explorer crams them INSIDE instead. The cure for this is to not use nonzero surrounding styles with size styles in the same style or tag.
Center text reliably using the following code:
In the stylesheet, place:
.cenx {text-align: center;}
Then, where you want to place the centered text, put this code:
<p class="bxfix cenx">Your Text to be Centered</p>
The p tag may be replaced by one of the h tags.
Center images reliably using the following code:
In the stylesheet, place:
.cenx {text-align: center;}
.ceni {clear: both;}
.bxfix {margin: 0; border: none; padding: 0;}
Then, where you want to place the centered image, put this code:
<div class="bxfix cenx">
<img src="yourimag.jpg" alt="description" class="ceni" />
</div>
There must be room for the image, or it won't work.
Center other objects reliably using the following code:
In the stylesheet, place:
.cenx {text-align: center;}
.ceni {clear: both;}
.bxcen {margin-left: auto; margin-right: auto; border: none; padding: 0;}
Then, where you want to place the centered object, put this code:
<div class="bxcen cenx">
<tag>Your object</tag>
</div>
Put the name of the tag for the object you have instead of the word "tag".