title: HTML: Include, or exclude, optional closing tags?
body: <p>Some <a href="http://www.w3.org/TR/REC-html40/index/elements.html" rel="noreferrer">HTML</a><sup>1</sup> closing tags are <em>optional</em>, i.e.:</p>
  
  <pre><code>&lt;/HTML&gt;
  &lt;/HEAD&gt;
  &lt;/BODY&gt;
  &lt;/P&gt;
  &lt;/DT&gt;
  &lt;/DD&gt;
  &lt;/LI&gt;
  &lt;/OPTION&gt;
  &lt;/THEAD&gt;
  &lt;/TH&gt;
  &lt;/TBODY&gt;
  &lt;/TR&gt;
  &lt;/TD&gt;
  &lt;/TFOOT&gt;
  &lt;/COLGROUP&gt;
  </code></pre>
  
  <p><strong>Note:</strong> Not to be confused with closing tags that are <strong>forbidden</strong> to be included, i.e.:</p>
  
  <pre><code>&lt;/IMG&gt;
  &lt;/INPUT&gt;
  &lt;/BR&gt;
  &lt;/HR&gt;
  &lt;/FRAME&gt;
  &lt;/AREA&gt;
  &lt;/BASE&gt;
  &lt;/BASEFONT&gt;
  &lt;/COL&gt;
  &lt;/ISINDEX&gt;
  &lt;/LINK&gt;
  &lt;/META&gt;
  &lt;/PARAM&gt;
  </code></pre>
  
  <p><strong>Note:</strong> <code>xhtml</code> is different from HTML. xhtml is a form of xml, which requires <em>every</em> element have a closing tag. A closing tag can be <strong>forbidden</strong> in html, yet <strong>mandatory</strong> in <code>xhtml</code>.</p>
  
  <p>Are the optional closing tags  </p>
  
  <ul>
  <li>ideally <em>included</em>, but we'll accept them if you forgot them, or</li>
  <li>ideally <em>not</em> included, but we'll accept them if you put them in</li>
  </ul>
  
  <p>In other words, <em>should</em> I include them, or should I <em>not</em> include them?</p>
  
  <p>The <a href="http://www.w3.org/TR/html401/intro/sgmltut.html#didx-element-3" rel="noreferrer">HTML 4.01 spec talks about closing element tags being optional</a>, but doesn't say if it's preferable to include them, or preferable to not include them.</p>
  
  <p>On the other hand, <a href="http://www.devguru.com/technologies/html/quickref/html_td.html" rel="noreferrer">a random article on DevGuru says</a>:</p>
  
  <blockquote>
    <p>The ending tag is optional. However, it is recommended that it be included. </p>
  </blockquote>
  
  <p>The reason I ask is because you just <em>know</em> it's optional for compatibility reasons; and they would have made them (<strong>mandatory</strong> | <strong>forbidden</strong>) if they could have.</p>
  
  <p>Put it another way: What did HTML 1, 2, 3 do with regards to these, now optional, closing tags. What does HTML 5 do? And what should <em>I</em> do?</p>
  
  <h2>Note</h2>
  
  <p>Some elements in HTML are <em>forbidden</em> from having closing tags. You may disagree with that, but that is the specification, and it's not up for debate. I'm asking about <em>optional</em> closing tags, and what the intention was.</p>
  
  <h2>Footnotes</h2>
  
  <p><sup>1</sup>HTML 4.01</p>