XHTML Tutorial: XHTML basics for beginners 5

Source: Internet
Author: User

How to convert the existing structure to XHTML

What DOCTYPE should we choose? The ideal situation is of course a Strict DTD, but for most of our designers who are new to web standards, the Transitional DTD (XHTML 1.0 Transitional) is currently an ideal choice (including this site, is also a transitional DTD ). Because this DTD also allows us to use the identifier, element, and attribute of the presentation layer, it is easier to pass W3C code verification.

From the current HTML to XHTML, pay attention to the following points:


1. Add a description of the document type to the header of each page. For example:

 

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

Of course, you can select another type.

 

2. The tag and name must be in lower case.

You can write a replacement program to replace all the tags in your HTML document with lowercase letters, and change the name attribute to lowercase letters.

3. All attribute values must be enclosed in quotation marks.

 

4. Separate labels, such as

 

5. Open the W3C DTD official website: http://validator.w3.org/check/referer. during verification, a general error may indicate that your label is embedded. You can also use tidy, a conversion tool provided by the official website to achieve conversion: Workshop.

6. Open the following page and enter the URL to verify our program: http: // js/standard.htm.

 

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.