One solution on the client
In fact, the solution is very simple. Open your website in the IE 8 browser. Don't be alarmed if you find any misplacement problem. On the menu bar, open the "Tools" option, find "Compatibility View" in the drop-down menu, and check it. Then, check whether the website is no longer misplaced.
2. Website Solution
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, write this code in the DIV framework.
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>