Smallest valid HTML documents

HTML4

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title></title>
<p>

HTML5

<!DOCTYPE html>

Smallest “useful” HTML5 document

<!DOCTYPE html>
<link rel=stylesheet href=site.css>
<script src=site.js></script>
<title>Page Title</title>
<h1>Heading</h1>
<p>Content...

Check em if you want. To avoid problems in IE you might want an opening body tag, but you don’t need a closing one!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.