In general, you can use CSS style: margin: 0 auto; or margin: 0 auto 1px; to center the DIV, but sometimes use margin: 0 auto can be centered in browsers such as firef and chrome, but not in ie678.
The following code:
<Style type = "text/CSS">
# Con {width: 980px; Martin: 0 auto ;}
</Style>
<Div id = "con"> margin: 0 auto content center display </div>
Solution 1
You can center the <body> declaration text of the webpage subject, that is, body {text-align: Center}
That is:
<Style type = "text/CSS">
Body {text-align: Center}
# Con {width: 980px; Martin: 0 auto ;}
</Style>
<Div id = "con"> margin: 0 auto content center display </div>
Solution 2
In fact, it is similar to the solution. It just adds a div to the outer layer of the DIV to be centered and centers it.
That is:
<Style type = "text/CSS">
# Con {width: 980px; Martin: 0 auto ;}
</Style>
<Div style = "text-align: Center"> <Div id = "con"> margin: 0 auto content center display </div>
Solution 3
The reason for this is the document's DTD declaration;
Modify DTD
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">