General Formatting Rules

Indentation

Indent using 2 spaces. Don’t mix tabs and spaces for indentation.

<ul>
<li>Fantastic</li>
<li>Great</li>
</ul>
.example {
color: #00f;
}

Capitalization

Use only lowercase.

This applies to XML and HTML element names, attributes, attribute values, CSS selectors, properties, and property values (with the exception of strings and case-sensitive XML element nodes).

<!-- Not Recommended -->
<A HREF="/">Home</A>

<!-- Recommended -->
<img src="google.png" alt="Google" />
/* Not Recommended */
{ color: #E5E5E5; }

/* Recommended */
{ color: #e5e5e5; }

Trailing Whitespace

Remove trailing white spaces.

<!-- Not Recommended -->
<p>What?</p>__

<!-- Recommended -->
<p>Yes, please.</p>

Encoding

Use UTF-8 (no BOM).

For XHTML, XML, and OPF, specify the encoding within the XML declaration.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>