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
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!