What is the correct terminology for an HTML / XML tag that closes?

I can’t remember the term used to describe the difference between the html tag, which is self-closing,

For example, <hr /> closes.

<p>This doesn't</p>

+6
source share
4 answers

Term used by the XML specification :

Tag with empty elements

the relevant part of the specification says:

Tags for empty items

  [44] EmptyElemTag :: = '<' Name (S Attribute) * S?  '/>' [WFC: Unique Att Spec] 

Tags with empty elements can be used for any element that has no content, regardless of whether it is declared using the EMPTY keyword. For interoperability, the empty-element tag MUST be used and MUST be used only for elements declared by EMPTY.

However, you can also often hear the term self-closing tag.

+12
source

I have always used the term "self-closing tag." I did not know that there is another term!

+2
source

As far as I know, "self-closing tags."

+1
source

I heard that they are called empty elements.

+1
source

Source: https://habr.com/ru/post/890643/


All Articles