Difference between IE and Firefox
FF sets text-align: center in the body. The DIV in the body is left aligned by default.
Iesets text-align: center in the body. Not only is text centered, but DIV in the body is also centered.
For the text in the DIV in the body. Because Div inherits the text-align: center of the body
Text will be centered in the DIV to which it belongs. Both ff and IE are like this. The difference is that DIV in IE will also be centered, So text is centered in Div, which is equivalent to centered in the whole body.
So how can we center the DIV in the body?
Set in Div:
Margin: 0 auto; // up/down 0, left/right automatic
How can I set the body?
In IE8, the body seems to be always full of the entire window (IE6 \ 7 has not been tried), and the width cannot be set.
You can set the width in FF, but the background color is still full throughout the window, and the reduced body is not centered, and you need to set margin: 0 auto, Which is troublesome.
Therefore, it is not recommended to set the width for the body. You must keep the width: 100%.