Never use <element />
in HTML since, depending on the version of HTML you are using and where you put it it either:
- doesn't mean what you think
- is a syntax error
- is optional and therefore a waste of time
The list of elements in HTML 4.01 has a column which shows you when start and end tags are optional or forbidden.
If you are writing XHTML then use <element />
when, and only when, the end tag is Forbidden in HTML 4. This is part of the HTML compatibility guidelines. (If you are one of the very tiny number of people serving XHTML as application/xhtml+xml (thus excluding users of IE 8 and lower) then you can use the syntax on any element).
If you are writing HTML 5. Then you can use that syntax under the same rules as XHTML - but it is optional and therefore I wouldn't bother.