Forum Moderators: open
XML requires a closing tag for all elements. Certain elements (<br>, <hr>, <img>, etc) do not have "closing tags" as defined by HTML. While <br></br> would be syntactically correct according to XML, it does not make much sense on a Web page (how is a browser supposed to interpret something like: <br>stuff</br> or <img>foobar</img>). To cause less confusion, and make more sense, it's been agreed that XML compatible HTML should use the shorthand closing tag as defined in the XML standard. Thus, <br> becomes <br/>, <img> becomes <img/>, etc. This, however, causes problems in certain browsers. To avoid these problems, a space is added before the slash. So, now we have <br /> and <img /> etc. That's still XML compatible, and now also works in browsers that are not XML compatible.
So, what are you supposed to use? Well, if it's an HTML page -- keep using <br> the way you are used to. However, if you are using XHTML the correct syntax is <br />.
What about elements that do not require a closing tag in the HTML recommendation (such as <p>, <tr>, <td>)? It's good practise to still use the proper closing tag, even if the HTML recommendation does not "require" it. In XHTML it's a requirement.
I'm pretty antique when it comes to html coding and have never used closing tags for anything that didn't require it (28k connections still linger in the back of my mind I guess). Suppose I should start getting into the habit to help prepare myself for future changes.