Home > Web Front-end > HTML Tutorial > Solve the problem that css div web pages cannot be centered under IE8 browser_html/css_WEB-ITnose

Solve the problem that css div web pages cannot be centered under IE8 browser_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:32:29
Original
1425 people have browsed it

Recently, we found that some customers’ websites are not displayed properly in IE8 browser. The main problem is that the website pages made with css div cannot be centered. Margin:0 auto; This CSS seems to be no longer useful for IE8, and the page cannot be centered. After careful analysis, the technical staff of our own planning company finally found a way to center the webpage under IE8:

Write margin:0 auto; in the body tag. It can be centered in IE7 and below, but not IE8. The solution is to write this code in a large div frame.

Program code