title: Do you quote HTML5 attributes?
body: <p><a href="https://dev.w3.org/html5/spec-LC/syntax.html#unquoted" rel="nofollow noreferrer">Attribute quotes are <strong>optional</strong> in HTML5</a>.</p>
  <p>What are the pros/cons to quoting them?</p>
  <pre><code>id=example                     &lt;!--quotes optional--&gt;
  href=http://example.com        &lt;!--quotes optional--&gt;
  class=&quot;example example-1&quot;      &lt;!--quotes required due to space--&gt;
  href=&quot;http://example.com/p=47&quot; &lt;!--quotes required due to '=' sign--&gt;
  </code></pre>
  <p>Update: Added advantages based on the answers:</p>
  <p>Advantages to quoting all attributes:</p>
  <ul>
  <li>all editors can deal with it properly</li>
  <li>more consistent</li>
  <li>better portability (easier to change doctype)</li>
  <li>easier to maintain (esp. if attributes might become empty)</li>
  <li>easier to 'find and replace' changes</li>
  <li>cleaner doc (if you think quotes improve readability)</li>
  <li>?</li>
  </ul>
  <p>Advantages to <strong>omitting</strong> optional quotes:</p>
  <ul>
  <li>slightly reduced filesize</li>
  <li>cleaner doc (if you prefer minimal text)</li>
  <li>?</li>
  </ul>