What’s the difference between HTML and XHTML?
The next generation of HTML (HyperText Markup Language) is XHTML (Extensible HyperText Markup Language). XHTML 1.0 is a reformulation of HTML 4.0 as an XML application, so it’s pretty much standard for software where syndication is used. XHTML was created to replace HTML. It’s stricter and cleaner than HTML and is endorsed by W3C as the recommended markup language for the internet. It’s almost identical to HTML with a few exceptions outlined below.
The main differences of HTML and XHTML are:
- Every element must be closed in HTML, this includes (but is not limited to) <br>, <hr>, <img> and <meta>. These tags are closed in XHTML by using a forward slash, so <br> becomes <br /> and <img> becomes <img />.
- All XHTML tags must be lowercase, tags such as <TITLE> would not pass XHTML validation.
- XHTML elements must be properly nested. An example of improperly nested elements is
<strong><em>Improperly nested elements</strong></em> - Valid XHTML documents must also be well formed. This means that all XHTML documents must have:
<html>
<head>...</head>
<body>...</body>
</html>
An example of properly nested elements is
<strong><em>Properly nested elements</em></strong>
Visit W3school.org for a tutorial on XHTML.

This text is vertically centered.