This article focuses on the differences between HTML and XHTML. In simple terms, XHTML can be considered an XML version of HTML, and XHTML syntax requires more rigor to conform to XML requirements.
The following are some of the major differences between XHTML vs. HTML:
XHTML requires proper nesting
XHTML all elements must be closed
XHTML is case sensitive
XHTML attribute values are in double quotes
XHTML replaces the Name property with an id attribute
Processing of XHTML special characters
XHTML requires proper nesting
The following are the correct nesting:
<p> Web Teaching Network <strong> Update speed is the fastest </strong>. </p>
The following are the wrong nesting:
<p> Web Teaching Network <strong> Update speed is the fastest </p></strong>.
XHTML all elements must be closed
In HTML, such as <p>,<li> tags, you may not write </p>,</li>, but in XHTML, you must require a write-close tag (Closing tag).
Like what:
<p> Web Teaching network is very serious.
should be written:
<p > Web Teaching Network is very serious. </p>
Handling empty elements
Some empty elements, written in XHTML, are preceded by spaces and slashes before ">". such as <br>, should be written <br/>.
The following is an example of an empty element:
<br />
<link rel="stylesheet" href="/styles/webjx.css" type ="text/css" />
<meta http-equiv="content -type" content="text/html; charset=UTF-8" / >
XHTML is case sensitive
HTML is case-insensitive, but XHTML is case-sensitive.