HTML vs XHTML

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:

				
					<!DOCTYPE html PUBLIC "-//tutorial testC//DTD XHTML 1.1//EN"
"http://www.webhostguru.com/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.tutorialtest.org/1999/xhtml">

				
			

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/u212091429/domains/mydevhelp.com/public_html/wp-includes/functions.php on line 5420

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/u212091429/domains/mydevhelp.com/public_html/wp-includes/functions.php on line 5420