IE8 is no longer useful to margin: 0 auto; this CSS does not seem to be useful, and the page cannot be centered. I will come back in the afternoon to see how to center it. The front-end of the Pacific also said that their company ignored the existence of IE8, test or previous version.
The reason is found. I wrote the margin: 0 auto; in the body tag. IE7 and lower can be centered, and IE8 won't work. The solution is Code Write it in the DIV frame.
Baidu search materials: program code <style type = "text/CSS">
Body {text-align: center; width: 100% ;}
# Wrap {
Text-align: left;
Width: 560px;
Margin: 0 auto;
Border: 1px solid #333;
Background-color: # CCC;
}
</Style>
<Div id = "Wrap"> effective methods in all browsers: <PRE> effective methods in all browsers: effective methods in all browsers:
</PRE>
</Div>
[This log was edited by Vincent at AM,]
ArticleFrom:Original Site
Reference announcement:View All references | I want to reference this article
Tags:Comment: 1 | reference: 0 | views: 467
reply fengyunshen [PM |] body
{< br> text-align: center;
}< BR ># wrap
{< br> margin: auto;
}< br>, you can try it.