What are all the valid self-closing elements in XHTML (as implemented by the major browsers)?

前端 未结 13 1763
夕颜
夕颜 2020-11-22 05:16

What are all the valid self-closing elements (e.g.
) in XHTML (as implemented by the major browsers)?

I know that XHTML technically allows any element to

13条回答
  •  温柔的废话
    2020-11-22 06:02

    They're called "void" elements in HTML 5. They're listed in the official W3 spec.

    A void element is an element whose content model never allows it to have contents under any circumstances.

    As of April 2013, they are:

    area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr

    As of December 2018 (HTML 5.2), they are:

    area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr

提交回复
热议问题