The difference between CSS-ie and Firefox center in IE window narrowing down

Source: Internet
Author: User

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%.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.