View Full Version : whats the difference between <br> and <br />

07-11-2005, 07:27 PM
I know it's better to use <br />

but why exactly is that?

I know it's a dumb question, but no one has ever really explained it to me.

07-11-2005, 07:38 PM
<br /> is just the way to close a <br> tag in XHTML so it is valid.

Grant Palin
07-11-2005, 07:39 PM
The first is from HTML, the second is the XHTML version. Use the second if you're writing XHTML-compliant code. You can even use it in HTML-compliant code without problems, I believe.

07-11-2005, 07:39 PM
Yeah I asked someone online after I posted. I figured it was something like that.

[m] at
07-11-2005, 10:08 PM
With any tags that don't have a closing tag, you should include a slash. It makes your code easier to read and understand.