HTML Tutorial
HTML Forms
HTML Graphics
HTML Media
HTML API
HTML Versus XHTML
XHTML is a more XML-based version of HTML.
What is XHTML?
XHTML full form is EXtensible HyperText Markup Language.
XHTML is more XML-based version of HTML.
XHTML is HTML described as an XML application.
XHTML is supported by all major browsers.
Why XHTML?
XML is a markup language in which all the documents should be marked up correctly.
XHTML was developed with an aim to make HTML more extensible and flexible to work with other data formats. Web browsers ignore errors in HTML pages and display the website even if some errors are present in the markup. XHTML has strict error handling features.
The Differences from HTML
- <!DOCTYPE> is compulsory.
- The XML attribute in <html> is compulsory.
- <html>, <head>, <title>, and <body> are compulsory.
- Elements should be properly nested.
- Elements should be closed.
- Elements should be in lowercase.
- Attribute names should be in lowercase.
- Attribute values must be quoted.
- Attribute minimization is restricted.
XHTML – <!DOCTYPE ….> Is Mandatory
An XHTML document should consist of an XHTML <!DOCTYPE> declaration.
The <html>, <head>, <title>, and <body> elements should be present.
Example: