Difference between XHTML and HTML

You are currently viewing Difference between XHTML and HTML

Difference between XHTML and HTML

HTML (Hypertext Markup Language) and XHTML (Extensible Hypertext Markup Language) are both markup languages used for creating and displaying web pages.
XHTML stands for Extensible Hypertext Markup Language. It can be considered as a part of the XML markup language this is because of XHTML have features of both XML and HTML. XHTML is extended from XML and HTML. XHTML can be considered as a better version of HTML.
HTML is the Hypertext Markup Language which is the most widely used language over the internet. HTML is used to create web pages and link them from one to another.

Difference between XHTML and HTML

HTMLXHTML
HTML stands for Hypertext Markup Language.XHTML stands for Extensible Hypertext Markup Language.
It is extended from SGML(standard generalized markup language).It is extended from XML and HTML.
It is not case sensitive as there is no mandatory rule to write the entire mark up in uppercase or lower case. It can also be a combination of both.It is case-sensitive, and every tag and attribute used inside must be in lowercase.
It is of document type file format.It is in markup language file format.
In HTML, it is not necessary to add < DOCTYPE > at the beginning of every page.In XHTML, it is compulsory to mention < DOCTYPE > at the top of every page.
It is not necessary to nest elements in order.In XHTML, elements should be nested properly in an order.
It is not necessary to close the tags in the order they are opened.It is necessary to close the tags in the order they are opened.
While using the attributes it is not necessary to mention quotes(" ").While using the attributes it is mandatory to mention quotes(" ").
Filename extension used are .html, .htm.Filename extension are .xhtml, .xht, .xml.

Leave a Reply