Page 1 of 1

Use of odd break tag

Posted: Thu Jul 29, 2004 5:25 am
by sunlion
I've RTFM'd, and spent hours googling this in various ways and just can't turn up any explanation of it...

What is the difference between these:

Code: Select all

echo ("A normal br tag ends this line.<br>");
and

Code: Select all

echo ("The weird br space slash ends this line.<br />");
It's that second usage that I don't understand... and it seems to do the same thing, so why the space and the slash? If there's something explaining this ANYWHERE, I apologize, but it seems that it's something you're expected to know even before saying Hello World.

Posted: Thu Jul 29, 2004 5:30 am
by Skittlewidth
Its to do with tightening up the HTML conventions.

As <br> never used to have a closing tag, the <br/> sort of denotes its opened and closed in one go. Its the same with input fields and stuff that doesn't have a matching closing pair.

Thats the way i understand it anyway... :?

Posted: Thu Jul 29, 2004 6:05 am
by sunlion
Thanks so much! I can't even begin to tell you how frustrating it was to finally find something totally undocumented anywhere (so it seems). Thanks again. I'm not a programmer, doubt I ever will be, but I did want to learn a few basics of PHP. This searching pretty much used up a whole day's study, but I'd have been back at it tomorrow...

Posted: Thu Jul 29, 2004 7:00 am
by d3ad1ysp0rk
Also, try googling xHTML. That's where it was introduced. It's just "better" coding practices.