HTML5 marks the inception of the living language while browsers, in conforming with long held standards and recommendations are backwards compatible and will render any previous version as though it is HTML5. This could lead to problems if there are obsolete tags that don’t render correctly, but that is the worst that can happen.
We also get around running older versions of HTML by making sure we include a namespace referral in the document type declaration (the DTD). The browser can then retrieve the specs from the URL it contains. That won’t be complicated since all the DTDs can be found on the W3C site, as well all over the web in older tutorials and articles.
HTML5 is the first iteration that does not need a namespace declaration. The browser has it built in. We don’t even need to declare content type unless we are going to serve XML. The majority of webpages on the internet are text/html, the default of HTML5.
On the face of it, when served as text/html we are following the recommendations of HTML 4.01 with a few extra bits (well, quite a lot, actually) thrown into the mix by the living language. Take an old HTML 4.01 document and swap out the DTD:
<!DOCTYPE html>
<html lang="en">
<head>
<charset="UTF-8"> <!-- new to HTML5, as I recall -->
<title>Sample Document</title>
</head>
<body>
</body>
</html>
That is the basic boilerplate of an HTML5 document.
Once you swap out the DTD, open the validator and select the tab that lets you paste in your code. Check both show original and verbose warnings and click Validate.
The results should be not that overwhelming and if the HTML 4.01 was valid for that DTD, there won’t be very much to revise to make it valid HTML5. This would be good practice, to be sure.
Now for XHTML 1.0 to validate under the HTML5 DTD, the code will still have to conform to the XHTML spec, and will need a content type declaration for text/xml-application if being served as XML. If you dig around on some older sites you may find an XHTML page you can run this experiment on. Be sure it validates as XHTML, then swap out the DTD and validate it again. Any major surprises?