Difference between XHTML and HTML
What is difference between XHTML and HTML?
XHTML every tags attributes write on marked up (Double Quotation).
XHTML every tags must be write in nested.
XHTML every tags must be write in lowercase.
XHTML every tags must be closed.
XHTML document only one root element.
Double Quotation
Invalid Structure:
<img src=../images/html.jpg width=128 height=128 >
XHTML Valid Structure:
<img src="../images/html.jpg" width="128" height="128" >
Nested Elements
XHTML every tags must be write in nested.
Invalid Structure:
<p><b>Hello, I am writing paragraph line with bold style</p></b>
XHTML Valid Structure:
<p><b>Hello, I am writing paragraph line with bold style</b></p>
Lowercase Elements
XHTML every tags must be write in lowercase.
Invalid Structure:
<LINK TYPE="TEXT/CSS" REL="STYLESHEET" HREF="jnj.css" />
<P>I am writing paragraph text.</P>
XHTML Valid Structure:
<link type="text/css" rel="stylesheet" href="jnj.css" />
<p>I am writing paragraph text.</p>
Elements must be closed
XHTML every tags must be closed correctly.
Invalid Structure:
<LINK TYPE="TEXT/CSS" REL="STYLESHEET" HREF="jnj.css" >
<img src="../images/html.jpg" width="128" height="128" >
XHTML Valid Structure:
<link type="text/css" rel="stylesheet" href="jnj.css" />
<img src="../images/html.jpg" width="128" height="128" />
One Root Element
Every XHTML document only one root element like <html>
start root element and end in last of XHTML document.
Valid Structure:
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
...
...
</body>
</html>