Never understood <BR />

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
Dashe
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 4:20 pm

Never understood <BR />

Post by Dashe »

Looking throught the tpls as I modifiy subSilver, I never understood these

Code: Select all

<BR />

<BR CLEAR="all" />
I have looked up some HTML references and can find no reference to this / just before the last >

Whats its function and is it HTML compliant ?

Just curious :)
User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Never understood <BR />

Post by Arty »

Dashe
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 4:20 pm

Re: Never understood <BR />

Post by Dashe »

Thanks for the reply CyberAlien.

The first thing I did (that any one should do) is search for my answer on yahoo and google and I got very similar results to what you kindly pointed me too, however, in all the guides to HTML, manuals etc... I have yet to come across a reference to the / just before the > within an opeing tag, for example

Code: Select all

<BR/>
as far as I was aware and as far as all those references you pointed me to they all have just

Code: Select all

<BR>
The only plave I have seen the / before the closing > on tags that are not closing tags themselfs (ie: </FONT> etc....) is in the phpBB tpl's

Like I said am only curious but it seems like there are too many of them to be a typo so am just interested into why they are there. Is there someting I dont know about - I hate that, when your not in the loop

Thanks in advance for any further replies :)
Klors
Registered User
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Re: Never understood <BR />

Post by Klors »

Afaik, it's not HTML compliant as HTML makes no provision for it, however most browsers will happily ignore that and carry on using it as normal.

It's XHTML.

The XML specs say, among other rules, that you have to close every start tag and XHTML is written to conform to XML. So <div>Contents <span>More Contents</span></div> as you'd expect.

However, what do you do in the case of <br> where you wouldn't normally put an end tag?

Well, you have to do <br></br> with no contents. Upon seeing this the w3c concluded that it's an ugly and long winded way of doing things and so specified a shorter way of closing empty tags thus, <br />.

Try searching on XHTML instead.
Dashe
Registered User
Posts: 11
Joined: Sun Jun 06, 2004 4:20 pm

Re: Never understood <BR />

Post by Dashe »

Excelent, I feel like I am informed now, thanks very much for the feed back Klors, much apriciated.

I havent got into XHTML at all, if you wouldnt mind and I know this is getting off topic a little so I will keep it breif but if you know, what would be the main difference / advantages from HTML and XHTML.

Like I say I dont want to go off topic but I would like to hear if from someone who uses it than read it in a manual if you know what i mean.

One other thing, whats "Afaik"
Klors
Registered User
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Re: Never understood <BR />

Post by Klors »

Sorry, "afaik" is a common abbreviation for "as far as I know".

The main advantage of XHTML is that it is XML compliant and so brings with it all the advantages of XML.

I'd advise reading some of the http://www.w3.org" target="_blank site for XML and XHTML specs and philosophy. There are plenty of links there to further material.

Alternatively, you could try a developer community such as http://www.devshed.com" target="_blank that would give you more tutorials and examples on the subject.
User avatar
VxJasonxV
Registered User
Posts: 341
Joined: Sun Mar 02, 2003 2:51 pm
Location: Castle Rock, CO
Contact:

Re: Never understood <BR />

Post by VxJasonxV »

http://www.w3schools.com" target="_blank is one of my favorites.

All tags must close, so, those with only one tag necessary (<img>,<br>,etc.) close themselves (<img /> <br />, etc.).

I remember reading something on W3Schools about the space between the last character and the /.

Supposedly, some version of netscape couldn't parse a tag correctly if it was not spaced. So, <img src="someimage.jpg"/> wouldn't appear on Netscape (or something to that effect), but <img src="someimage.jpg" /> would.
"If You Support It, They Will Come."
"Construction"
User avatar
SHS`
Registered User
Posts: 1628
Joined: Wed Jul 04, 2001 9:13 am
Location: The Boonies, Hong Kong
Contact:

Re: Never understood <BR />

Post by SHS` »

For all those blabbering on about XHTML, <BR /> isn't XHTML.

Please read specifications more closely. ;)
Jonathan “SHS`” Stanley • 史德信
phpBB™ 3.1.x, Bug/Security trackers
phpBB™ Bertie Bear 3.0 — prosilver Edition!Asking Questions The Smart Way
User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: Never understood <BR />

Post by A_Jelly_Doughnut »

In XHTML, all tags must be lowercase. Therefore, <BR /> isn't valid, but <br /> is.

I can't wait for the banishment of <img> in XHTML 2.0 :twisted:
A_Jelly_Doughnut
Klors
Registered User
Posts: 95
Joined: Fri Sep 19, 2003 2:08 pm

Re: Never understood <BR />

Post by Klors »

SHS` wrote:For all those blabbering on about XHTML, <BR /> isn't XHTML.

Please read specifications more closely. ;)
"All those blabbering on about XHTML" didn't state that <BR /> is XHTML. They all said <br /> is XHTML.

The question being answered:
I have looked up some HTML references and can find no reference to this / just before the last >

Whats its function and is it HTML compliant ?
So there's not even any mistake by implication from the question.

The specifications have been read very closely thankyou. ;)
Post Reply