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

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

    What about and ? Why aren't they on that list?

    Quick rule of thumb, do not self-close any element which is intended to have content, because it will definitely cause browser problems sooner or later.

    The ones which are naturally self-closing, like
    and , should be obvious. The ones which aren't ... just don't self-close them!

提交回复
热议问题