Jump to content

What Is This?


Recommended Posts

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.


Link to comment
Share on other sites

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 ( :lol: ) 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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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! :lol:



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...