HTML 2.0 (RFC 1866) was developed by the IETF's HTML Working Group, which closed in 1996 it set the standard for core HTML features based upon current practice in 1994. Note that with the release of RFC 2854, RFC 1866 has been obsolate and its current status is HISTORIC.

HTML 3.2 W3C's first Recommendation for HTML which represented the consensus on HTML features for 1996. HTML 3.2 added widely-deployed features such as tables, applets, text-flow around images, superscripts an subscripts, while providing backwards compatibility with the existing HTML 2.0 Standard.

HTML 4.0 First released as a W3C Recommendation on 18 December 1997. A second release was issued on 24 April 1998 with changes limited to editorial corrections. This specification has now been superseded by HTML 4.01.

The Most Important Differences:

  • XHTML elements must be properly nested
  • XHTML documents must be well-formed
  • Tag names must be in lowercase
  • All XHTML elements must be closed
Elements Must Be Properly Nested
In HTML some elements can be improperly nested within each other like this:
 <b><i> This text is bold and italic </b> </i>

In XHTML all elements must be properly nested within each other like this:
 <b><i> This test is bold and italic </i> </b>

Note: A common mistake in nested list, is to forget that the inside list mustbe within an element.

Documents Must Be Well-formed
All XHTML elements must be nested within the <html> root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element.

Tag Names Must Be In Lower Case
This is because XHTML documents are XML applications. XML is case-sensitive. Tags like <br> and <BR> are interpreted as different tags.
This is wrong:
 <BODY>
<P> This is a paragraph </P>
</BODY>

<html>
<head> ... </head>
<body> ... </body>
</html>
This is correct:
<body>
<p> This is a paragraph </p>
</body>


All XHTML Elements Must Be Closed
Non-empty elements must have an end tags.
This is Wrong:
<p> This is paragraph
<p> This is another paragraph

This is correct:
<p> This is a paragraph </p>
<p> This is another paragraph </p>


Empty Elements Must Also Be Closed
Empty elements must either have an end tag or the start tag must end with />
This is Wrong:
This is break <br>
Here comes a horizontal rule <hr>
Here's an image <img src="happy.gif" alt="Happy face">

This is Correct:
This is a break <br />
here comes a horizontal rule: <hr />
Here's an image <img src="happy.gif" alt="Happy face"/>

Mandatory XHTML Elements
All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element.
This Is a Minimun XHTML document template:
<!DOCTYPE doctype goes here >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Title goes here </title>
</head>
<body>
Body text goes here
</body>
</html>

Note: The DOCTYPE declaration is not a part of the XHTML document itself. It is not an XHTML elements and it should not have a closing tag.

Note: The xmins attribute inside the <html> tag is required in XHTML. However, the validator on w3.org does not complain when this attribute is missing in an XHTML document. This is because "xmins=http://www.w3.org/1999/xhtml" is a fixed value and will be added to the  <html> tag even if you do not include it.