The application of text-align: center shows different effects in different browsers, this article shows different displays in IE7, IE8 and IE9, and solves the problem of left-deviation displayed in IE8.
In IE7 and some browsers interpreted as elements and text within the element are centered.
In IE8 and IE9, some browsers interpret that the text within the element is centered.
Can be found in IE7, the elements use the text-align: center; After the div and the text are centered,
In IE8, the text within the element is centered, but the div element is not centered.
There are two solutions to this type of imbalance.
1 is ie7 tend to ie8, that is, ie7 also showed the effect of IE8, the element left home. The method is to add float: left on the element inside it
2 is so ie8 trend ie7 that is, ie8 also shows the effect of ie7, the element is centered. The method is to add margin: 0 auto inside the element; it's fine.
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.