Minimalist HTML Templates

I often find myself writing the same code over and over for each new HTML or XHTML document I start. Below are some minimalist HTML templates for various doctypes which you can copy and paste into any new documents you are creating. All of these validate.

minimalist html templates
Visit HTML5-Templates.com for free templates

HTML5

<!DOCTYPE html>
<html>
    <head>
        <title>Title</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
        <p>Content</p>
    </body>
</html>

HTML5 is the most important doctype nowadays and this is the code to get started. This is just the very basic frame however. Visit the HTML Cheat Sheet to find out what you shouldn’t forget meta tags and other important elements to add to the page.

HTML 4.01 Strict

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>Title</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
        <p>Content</p>
    </body>
</html>

XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Title</title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
    </head>
    <body>
        <p>Content</p>
    </body>
</html>

XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Title</title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
    </head>
    <body>
        <p>Content</p>
    </body>
</html>

We hope these templates save you some time when you start working on your next project.