Markup & Templates Styleguide
This document describes tag guidelines and markup for templates.
A proper Doctype which triggers standards mode in your browser should always be used. Quirks mode should always be avoided.
For simplicity we will use the
html5 doctype, which is easy to remember (provided by Html5Boilerplate).
- Paragraphs of text should always be placed in a
<p>tag. Never use multiple
- Items in list form should always be in
<dl>, Never a set of
- Every form input that has text attached should utilize a
<label>tag. Especially radio or checkbox elements.
- Even though quotes around attributes is optional, always put quotes around attributes for readability.
<p class="line note" data-attribute="106">This is my paragraph of special text.</p>
Use htmlentity number over name. Names will cause XML requests to fail. Here is a short list of common entities:
<, should be
>, should be
&, should be
…, should be
–, should be
—, should be
‘, should be
’, should be
“, should be
”, should be
- For apostrophes in word contractions, use the right single quote
- Make use of
<th>tags (and Scope attribute) when appropriate. (note:
<tbody>for speed reasons. You want the browser to load the footer before a table full of data.)
<table summary="This is a good table example."> <thead> <tr> <th scope="col">Table header 1</th> <th scope="col">Table header 2</th> </tr> </thead> <tfoot> <tr> <td>Table footer 1</td> <td>Table footer 2</td> </tr> </tfoot> <tbody> <tr> <td>Table data 1</td> <td>Table data 2</td> </tr> </tbody> </table>