I was just wondering whether it is acceptable to close a common tag, eg. a <span>
which requires no data using the XHTML closing slash to reduce markup.
So for example:
<span id='hello'></span>
could be written as
<span id='hello' />
I was just wondering whether it is acceptable to close a common tag, eg. a <span>
which requires no data using the XHTML closing slash to reduce markup.
So for example:
<span id='hello'></span>
could be written as
<span id='hello' />
There are
empty
orself-closing
tags. Span is not one of them.http://justinsomnia.org/2005/12/there-are-only-10-legal-xhtml-empty-tags/
No. What are all the valid self-closing elements in XHTML (as implemented by the major browsers)?
No you can't do that,
span
is not self-closing tag. Here are the self closing tags: