Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the differences between XHTML and HTML

Shulou Source: shulou.com Published: 2022-06-01 10:48:31 10月04日 Update

Today, I would like to share with you what are the relevant knowledge points about the difference between XHTML and HTML. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

The most important difference between XHTML and HTML is:

Document structure

XHTMLDOCTYPE is mandatory.

The XMLnamespace property in is mandatory

, and are also mandatory

Element syntax

XHTML elements must be nested correctly

The XHTML element must always be closed

XHTML elements must be lowercase

An XHTML document must have a root element

Attribute syntax

The XHTML property must be lowercase

The XHTML attribute value must be enclosed in quotation marks

XHTML attribute minimization is also prohibited

It's mandatory.

XHTML documents must have XHTML document type declarations (XHTMLDOCTYPEdeclaration).

You can find the complete XHTML document type in the label reference manual of the rookie tutorial.

, and elements must also exist, and the xml namespace must be specified for the document using the xmlns attribute in.

The following example shows an XHTML document with the fewest required tags:

Document title

Document content

These are all the contents of the article "what's the difference between XHTML and HTML?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Document element attribute mandatory knowledge article mandatory content lowercase tag type grammar faceted reference different large minimum important example most Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL MariaDB Microsoft Shulou Information