See Quirks mode and strict mode and Activating Browser Modes with Doctype. Basically it's good practice to force browsers (particularly IE) to be more standards-compliant by always using a DOCTYPE at the top of the document, like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
With that all browsers will horizontally center with margin: 0 auto
.
Edit: this question originally said "vertical centering, hence the answer below:
From Vertical Centering in CSS:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Universal vertical center with CSS</title>
<style>
.greenBorder {border: 1px solid green;} /* just borders to see it */
</style>
</head>
<body>
<div class="greenBorder" style="display: table; height: 400px; #position: relative; overflow: hidden;">
<div style=" #position: absolute; #top: 50%;display: table-cell; vertical-align: middle;">
<div class="greenBorder" style=" #position: relative; #top: -50%">
any text<br>
any height<br>
any content, for example generated from DB<br>
everything is vertically centered
</div>
</div>
</div>
</body>
</html>
Basically, it's complicated involving relative+absolute+relative positioning (whereas its trivial with a table cell contents).