What do you call tags that need no ending tag?

后端 未结 13 1450
旧时难觅i
旧时难觅i 2020-12-13 00:12

There are HTML tags, such as , and

相关标签:
13条回答
  • 2020-12-13 00:24

    I've called them self-closing, single tags and monotags, I don't know why I haven't adopted a single term though.

    0 讨论(0)
  • 2020-12-13 00:24

    This sort of Element is an empty element (since it does not contain anything, it just may have attributes). That's the correct way according to the specification, AFAIK. (If the Element is not empty, the Element consists of the opening tag, the closing tag, and the content inbetween.)

    Those tags are also called "unpaired", "single", or "bachelor tags". The term "self-closing" I don't like because they don't close themselves any more than other tags, it's still you or your program that puts the "/>" in there.

    0 讨论(0)
  • 2020-12-13 00:24

    Those tags are called "Standalone Tags". Standalone tags are having no closing tags in HTML

    But in XHTML they have to be self closed by adding forward slash before the closing angular bracket

    0 讨论(0)
  • 2020-12-13 00:25

    That is called a self closing tag

    0 讨论(0)
  • 2020-12-13 00:26

    The term is self-closing.

    0 讨论(0)
  • 2020-12-13 00:27

    There are paired and unpaired tags.

    Unpaired tags are opened and do not have to be closed. They stand alone.

    <img />, <input /> and <button />
    
    0 讨论(0)
提交回复
热议问题