How to create a webpage using margin: 0auto when the entire page does not reside _ html/Xhtml _

Source: Internet
Author: User
Divstylemargin: 0auto cannot center the page because L-Blog does not add a DTD before HTML by default, so IE explained the document in HTML instead of XHTML and wrote a jsp page today.

123xxx

How can this problem be solved? The page cannot be displayed in the center, and other styles may be inexplicably displayed.

Later I found a solution to this problem:

It turns out that L-Blog does not add DTD before HTML by default, So IE will explain the document in HTML instead of XHTML.
The problem lies not in CSS but in the XHTML web page itself.
This code must be added to make the above settings effective:

The Code is as follows:




If you want more Strict XHTML 1.0 Strict or XHTML 1.1, please refer to the relevant documentation.
The above tests are based on Windows XP SP2 IE6 and FireFox 1.0 Final version.

We recommend that you do not delete this line if the css style is required on the page:

The Code is as follows:


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.