HTML5 tags can be omitted. Without affecting the page layout, it can save the size of the web page and reduce the amount of code.
Certain marks can be omitted.
Omitting the start marker does not mean that the marker does not exist, it is implicit, but it still exists.
An HTML file always has a root tag HTML, even if the string <html> does not appear anywhere in the page tag.
The start tag of the HTML tag can be omitted if the first tag within the HTML tag is not a comment.
The end tag of the HTML tag can be omitted if the HTML tag is not followed immediately after a comment.
The start mark of the head tag can be omitted if the mark is empty, or the mark in the head is first a mark rather than a comment.
The end mark of the head mark can be omitted if the head mark is not immediately followed by the space characters or comments.
The start tag of a body tag can be omitted if the tag is empty, or if the first tag in the body tag is not a space character or comment, but if the first tag inside the body tag is a script or style tag, the body tag cannot be omitted.
The end tag of a body tag can be omitted if the body tag is not followed immediately after the comment.
The end tag of the li tag can be omitted if the li tag is followed by another li tag or if there is no parent tag for more content.
The end tag of a DT tag may be omitted if the tag of dt is immediately followed by another dt tag or a dd tag.
The end tag of the dd tag can be omitted if dd is immediately followed by another dd tag or dt tag, or if there is no subsequently more content of the parent tag.
The end tag of the p tag can be omitted if the p tag is followed by an address, article, aside, blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, menu, nav, ol, p, pre, section, table, ul, tag, or if there is no more content of the parent tag and the parent tag is not a tag.
The end tag of an RT tag can be omitted if the rt tag is followed by the RT or RP tag, or more content without the parent tag.
The end tag of an rp tag can be omitted if the rp tag is followed by an RT or RP tag, or more content without a parent tag.
The end tag of an optgroup tag can be omitted if the optgroup tag is followed by another optgroup tag, or there is no parent tag for more content.
The end tag of an option tag can be omitted if the option tag is followed by another option tag, or an optgroup tag, or more contents after it is not a parent tag.
The start mark of the COLGROUP mark may be omitted if the first mark within the COLGROUP mark is a col mark, or if the mark is not followed by another COLGROUP mark and its end mark has been omitted. (COLGROUP cannot be ignored if the tag is empty.)
The end tag of the COLGROUP tag can be omitted if the COLGROUP tag is not immediately followed by a space character or comment.
The end tag of thead tag can be omitted if the head tag is followed by a tbody or tfoot tag.
The start mark of the tbody tag can be omitted. If the tbody tag inside is first a TR mark, if the tbody, head, and tfoot marks of the end mark have not been omitted after the tag. (It cannot be ignored if the tag is empty.)
The end tag of the tbody tag can be omitted if the tbody tag is followed by a tbody or TFOOT tag, or if there is no parent tag afterwards more content.
The end tag of the TFOOT tag can be omitted if the TFOOT tag is followed by a tbody tag, or if there is no parent tag subsequently for more content.
The end tag of one TR tag may be omitted if the TR tag is immediately followed by another TR tag, or if there is no parent tag subsequently for more content.
The end tag of a TD tag can be omitted if the TD tag is followed by the td, the th tag, or if there is no parent tag subsequently for more content.
The end tag of a th tag can be omitted if the th tag is followed by td, the th tag, or if there is no parent tag afterwards more content.
However, if the start marker has any one or more attributes, it cannot be omitted.
Original English manuscript: http://www.w3.org/TR/2010/WD-html5-20100624/syntax.html#optional-tags