Difference Between XHTML and HTML
HTML and XHTML are completely differ from each other in document
structure,elements and attribute format.
XHTML
->XHTML is proposed by W3C Recommendation in 2000.
->It is developed by W3C(World Wide Web Consortium).
->XHTML files are saved with .xhtml, .xht, .xml , .html and .htm extension.
->XHTML is an XML application.
Eg:
- <html>
- <head>
- <title>This is an XHTML page </title>
- </head>
- <body>
- <p> This is my first XHTML page </p>
- </body>
- </html>
As shown in the above example, there is both tag ie. starting tag as well as ending tag (ie <p> and </p>). That means it follows all principles.
HTML
->HTML is proposed by Tin-Berners-Lee in 1987.
->HTML is developed by W3C and WHATWG.
->HTML files are saved with .html and .htm extension.
->HTML is an SGML (Standard Generalized Markup Language) application.
Eg:
- <html>
- <head>
- <title>This is an XHTML page </title>
- </head>
- <body>
- <p> This is my first XHTML page
- </body>
- </html>
As shown in the above example, there is no ending tag ie </p> that means it doesn't follow the rule. That's why we need the XHTML instead of HTML.