Quick Difference between HTML and XHTML

XHTML (Extensible HTML) is the extended form of HTML (HyperText Markup Language) . Which is almost identical to HTML 4.0.1. The main thing which forced the language designers to create XHTML was wrong coding standered that is still being accepted by some browsers but not by all. So the requirement was to create uniform language that should be strictly followed by all browsers. So language designers has made few changes to existing HTML in order to make it XHTML.
Following are some crucial difference in XHTML and HTML

*. XHTML is choosy then HTML. There are some element that must appear in the doc. This mandatory includes HTML,Head,Body.

*. In XHTML every starting tag should have end tag as well. Like <p></p>

*.In XHTML all tags must be written in lowercase . Even attribute should also be in lowercase.

*. MIME type must be declared in HTTP  headers as “application/xhtml” in each document.

*. XHTML is case sensitive where as HTML is not follows this pattern strictly.

*. HTML is an application of SGML (Standered Generelized Markup language)  where as XHTML is an application of XML (extensible markup langauage)

*. In HTML any attribute can have blank value where as in XHTML if there is any attribute there then there must be a value into it. Also the attributes value should be in single or double quotes.

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)