What is the difference between XHTML and HTML?

Source: Internet
Author: User

What is the difference between XHTML and HTML?

XHTML syntax is more rigorous and has certain rules. If you do not follow the rules, errors may occur. But don't worry too much, because the XHTML rule is not too difficult, it is not much different from the HTML4.01 standard.

Note the following:

1. The XHTML tag must be properly closed, even if it is a single tag.

Error: <p> I am a p tag.

Correct: <p> I am a p tag. </P>

Error: <br>

Correct: <br/>

2. XHTML labels must be correctly nested

Error: <div>

Correct: <div> 3. The XHTML tag must be in lower case.

Error: <DIV> I am a div tag. </DIV>

Correct <div> I am a div tag. </Div>

4. All attributes of the XHTML tag must use double quotation marks.

Error: <div style = font-size: 14px> I am a div </div>
Correct: <div style = "font-size: 14px"> I am a div </div>

5. The XHTML document must have the root element.

All XHTML labels must be nested in the

Related Article

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.