22 2009

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

Elements allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>