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

前端 未结 13 1860
夕颜
夕颜 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:03

    Better question would be: what tags can be self-closed even in HTML mode without affecting code? Answer: only those that have empty content (are void). According to HTML specs the following elements are void:

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

    Older version of specification also listed command. Besides, according to various sources the following obsolete or non-standard tags are void:

    basefont, bgsound, frame, isindex

提交回复
热议问题