Comment by hnlmorg

1 month ago

You close them in the same tag:

    <br/>

This syntax is ignored in HTML. The / is thrown away and has no effect.

This non-closing talisman means that <div/> or <script/> are not closed, and will mess up nesting of elements.

  • In HTML, yes. But I thought the OP was talking about XHTML?

    • No. In XHTML, you are required to close your p and li tags. In HTML, the "self-closing" tag is meaningless. That slash doesn't do anything. You can't self-close a <script> or <div> tag. It only appears to work for tags that are don't allow closing.

      4 replies →