The difference between XHTML and HTML

Source: Internet
Author: User

XHTML is more rigorous, has certain rules, and is prone to error if it does not follow the rules. But don't worry too much, because the rules of XHTML are not too difficult, it is not much different from the HTML4.01 standard.

It is important to note the following points:

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

Error:<p> I am a P tag.

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

Fatal error:<br>

Correct: <br/>

2.XHTML tags must be nested correctly

Error:<div>

Correct:<div>3.XHTML tags must be lowercase

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

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

4.XHTML label all attributes must use double quotation marks

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

A 5.XHTML document must have a root element.

All XHTML tags must be nested within the

The difference between XHTML and HTML

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.