The difference between <br> and <br/>

A lot of HTML references and programs are using <br/> instead of <br> lately, and I didn’t understand the difference between the two because they both do the same thing: forces a break in the current line of text.

<br/> is XHTML compliant, which states that:

Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>.

So what is XHTML? It’s an enhanced version of HTML that’s compatible with XML. I ain’t going to explain XML because: 1) I don’t know it well enough to explain it, and 2) I don’t care.

Update (for Steve): So use <br/> if you want your web pages to be XHTML compliant. Right, big whoop-de-do.

6 Replies to “The difference between <br> and <br/>”

  1. it’s probably derived from XML standards. we’ve been using it that way with xml tags, if the tag doesn’t start and end, it just starts and contains nothing, you put the forward slash in your tag. I think XML came first?

  2. XML is an offshoot of HTML =eXtensible Markup Language. Like the author, I don’t know enough about it to give a lecture but I do know HTML came first. Formatting to make both FireFox and IE7 happy is a b*tch!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.