⚠️ Warning: this is an old article and may include information that’s out of date. ⚠️

Introduction

Often times I end up creating short pages for testing short pieces of code, and I only need a very basic HTML template to write in. Short of using HTML5 Boilerplate, I just use a quick piece of code like the following. (note: yes, this has issues in IE, so you may want to use HTML5 Shiv/Shim)

The code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>

    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
    />
    <link rel="stylesheet" href="" />
  </head>

  <body>
    <header></header>

    <div></div>

    <footer></footer>

    <script src=""></script>
  </body>
</html>

Edit: Self-closed tags for compatibility.
Edit2: removed type="text/css" from the link tag