A lone <br>
is invalid in XHTML, since XML documents must close each tag they open. <br />
is semantically the same as <br></br>
in XML documents, and is referred to as a self-closing tag, so <br />
is used when writing XHTML, or HTML documents that will be read by an XML parser.
This applies to all other tags that do not have a closing tag in HTML, such as <hr />
and <meta />
.
Both are valid HTML, so there is no reason not to use <br />
, unless you are writing for a broken HTML parser.
Note that in XML, <br/>
is valid. However, older HTML parsers that don't know about self-closing tags have been known to choke on this. If a space is inserted before the tag name and the self-closing tag token (/
) then these parsers see /
as an attribute, or as noise that is discarded. Therefore, one should always make sure to put a space between the element name and the self-closing tag token for compatibility with these broken parsers.
` the xhtml thing where you need to self close the tags, it's strict – Mr. Alien Aug 22 '13 at 14:45