TCH-Thomas Posted June 27, 2004 Share Posted June 27, 2004 I have been playing around with coppermines template.html and I among other things find this: >{MAIN_MENU}<br /> 1. Why is the ><br> written with a / inside it? 2. Will I destroy all if I remove the / ? Quote Link to comment Share on other sites More sharing options...
btrfld Posted June 27, 2004 Share Posted June 27, 2004 Hi Thomas. The new form of the break <br /> is the XHTML form. Part of the XHTML specification is that all tags must be 'closed', even ones like <br> and <img> that have no 'interior' component. I'm not sure, but I think that placing the space before it keeps HTML 4.x from choking on it. As for whether you can remove it: it depends upon the DOCTYPE declared at the top of the file. If you're declaring this as an XHTML document and you remove the /, the document won't validate. It will still probably work, but the results may be unpredictable, depending upon what browser is interpreting it. http://www.w3schools.com/xhtml/default.asp is a place to start learning about the differences. Hope this helps. Jim Quote Link to comment Share on other sites More sharing options...
stevevan Posted June 27, 2004 Share Posted June 27, 2004 I've usually seen the slash written as </li> or </br>. It's called an end tag. Per my HTML 4 book that I consult quite frequently ( ) the <br> command doesn't require an end tag. You probably won't hurt anything by removing them, but it won't hurt anything to leave them in either. As I was once told..."If it ain't broke, don't fix it!" EDIT: thanx btrfld! I'm just typing too slow this a.m. Need more coffee! Quote Link to comment Share on other sites More sharing options...
annie Posted June 27, 2004 Share Posted June 27, 2004 I don't know why it's written like that, but it resembles escaping. Escaping is done in cgi-scripts using newer Perl versions. It's to avoid the script getting confused about a character that can have meaning in the code, and that also is used in stuff that's printed out. The @ is always escaped. /@ if I remember correctly. Quote Link to comment Share on other sites More sharing options...
purplespider Posted June 27, 2004 Share Posted June 27, 2004 Would just like to say that btrfld is correct on this one, I'm studying Computer Science and have done a whole module on XHTML. Its's just the way XHTML works, all tags have to be closed. Just to avoid confusion but sorry stevevan, the reason its not in ur HTML4 book is because its an XHTML command, so if, as btrfld said, the doctype is XHTML I wouldn't remove it. And sorry annie, your correct that /'s represent escaping in Perl and Java but thats not the case in HTML. Just thought I'd clear things up! James Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted June 27, 2004 Author Share Posted June 27, 2004 Thanks guys Quote Link to comment Share on other sites More sharing options...
stevevan Posted June 27, 2004 Share Posted June 27, 2004 That's why I love these forums! You can learn so much from everybody! Thumbs Up Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.