Mar 31 2004

The difference between <br> and <br/>

Jody posted this at 8:12 am under internet & computers, what i learned today

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.


4 Responses to “The difference between <br> and <br/>”. Leave a Reply.

  1. Steveon 31 Mar 2004 at 8:16 am

    I read your comment and STILL didn’t learn anything!

  2. Chris Oon 31 Mar 2004 at 8:42 am

    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?

  3. Phillipon 31 Mar 2004 at 9:22 am

    Wow.

  4. TG OfficeTexon 13 Aug 2008 at 12:57 pm

    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!

Comments RSS

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: This post is over 4 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.