Skip to content

Commit d63708f

Browse files
Help developers better understand self-closing-tag syntax
* Clarify that the solidus character in an HTML-element start tag doesn’t mark the HTML element as self-closing. * Explicitly caution developers that the solidus character, if directly preceded by an unquoted attribute value, becomes part of the attribute value rather than being discarded by the parser.
1 parent f3550cd commit d63708f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106626,8 +106626,12 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
106626106626

106627106627
<li>Then, if the element is one of the <span>void elements</span>, or if the element is a <span
106628106628
data-x="foreign elements">foreign element</span>, then there may be a single U+002F SOLIDUS
106629-
character (/). This character has no effect on <span>void elements</span>, but on <span>foreign
106630-
elements</span> it marks the start tag as self-closing.</li>
106629+
character (/), which on <span>foreign elements</span> marks the start tag as self-closing. On
106630+
<span>void elements</span>, it does not mark the start tag as self-closing but instead is
106631+
unnecessary and has no effect of any kind. For such void elements, it should be used only with
106632+
caution — especially since, if directly preceded by an <a href="#unquoted">unquoted attribute
106633+
value</a>, it becomes part of the attribute value rather than being discarded by the
106634+
parser.</li>.
106631106635

106632106636
<li>Finally, start tags must be closed by a U+003E GREATER-THAN SIGN character (&gt;).</li>
106633106637
</ol>

0 commit comments

Comments
 (0)