c FireFox will glady center the div with just

div {
 width: auto;
}

but IE7 will keep the div aligned at its default. Hence we need a little trick here to make it the way we want it. What we do is we create a div wrapper using another div, and have the css code like this

div.wrapper {
 text-align: center;
}
div.wrapper div {
 text-align: left;
 width: auto;
}

The text align left is optional and is used to explicitly redefine the text alignment for the inner div so that it is independant of the wrapper div’s text align attribute value.