It's a line break tag. <br> is the break and </br> is the end of the break. However, there is no need for th </br> Col
The reason people use <br /> is because they are writing semantically (precisely) for XHTML (and maybe HTML4.01 strict too I think). In ye bad old days, people used <br>. <br> is one of the so-called "empty" tags, like meta and img. They never had a closing tag and still don't. That is, there IS NO <img>blah.gif</img> <---- no no But even though they're empty, XHTML and HTML4.01 strict require that there's something saying where the end of the tag is. Thus, />. Some browser or somebody has a problem with just <br/> so a space is put in there to "fill" it: <br /> NEVER use <br> <br /> because empty tags do not come in twos. Ever. But you'll see it now and then. So also for meta you'll see <meta blah blah stuff /> and <img src="wherever" alt="" />
If you are using XML on your site, then <br> will give an error. <br /> is the correct way of writing a line break. Most browsers will recognize both.
Most modern browsers understand <br>. Although I heard netscape kicks up a fuss. So always use <br /> for better practice
Let us clear up some misconceptions: the line break element <br> is specified in the W3C HTML 4.01 recommendation (with all Doctypes) and renders correctly in all Browsers. More importantly, it is specified in ISO-HTML which is the standard iteration of HTML (the W3c can only publish recommendations). See my ISO-HTML page for a thorough explanation. I have employed <br> for line breaks there as an exemplar of its use. I have also replicated my HTML 4.01 Strict Home page in ISO-HTML -- you can see the Validation result output here (scroll down for Markup). It is wrong to think of <br /> as somehow superior or more correct than <br> -- it is simply the well-formedness syntax employed in XML documents. XHTML has its own monumental usage problems -- for instance, practically all XHTML Web pages are being served as HTML without XML functionality -- I will be glad to illustrate that here if there is enough interest. James
Essentially, <br> = HTML, <br /> = XHTML The reason there is a space is because old Netscape browsers did not render <br/> correctly.
No that is not the reason -- Netscape Browsers had no problem rendering <br>. The answer is found in Appendix C.2. of the W3C Recommendation for XHTML 1.0 (2nd edition) - Empty Elements (paraphrasing): a space must be included before the trailing / and > of empty elements such as <br /> and <hr />, etc. ..........
You are incorrect. <br/> had problems in a previous Netscape browser as I said. As XHTML, it can be written that way, however the W3C Recommendations for HTML Compatibility Guidelines recommend using a space before the trailing slash on all empty tags. See their site for more info. If you notice, that's the appendix you referenced, so you must not have read the appendix title. For the declaration of how to create a proper empty tag, you should have looked at 4.6 of the guide.
I didn't say that -- I said that Netscape Browsers did not have any problem rendering <br>. That is what I pointed out. Actually the header for Appendix C indicates that it summarizes guidelines for authors who wish their XHTML documents to render in existing HTML user agents -- which all extant graphical Browsers are (not necessarily how they are served). In XML, empty elements can be terminated using either, for example, <br/> or <br /> ref: http://www.stylusstudio.com/w3c/xml11/sec-starttags.htm
The tag <br> is part of the group of html tags that doesn't need been closed. However, the tag <br/> is recognized by the browser and it indicate that the BR tag is open and close in-self. Another example of this kind of tags is <img /> tag.
You quoted me as having said, "The reason there is a space is because old Netscape browsers did not render <br/> correctly." and then directly after that you said, "No that is not the reason -- Netscape Browsers had no problem rendering <br>." I made the assumption that you had a typo. Apparently that was incorrect and you were really just saying I was wrong and following with an argument unrelated to what I had said. You say actually as if I implied something else was meant by the heading of Appendix C (but good work with the copy/paste). My original post (the one you said was wrong) said that <br /> is used because <br/> is XHTML but an old version of Netscape had rendering problems with that. My post was correct, and that's why you see that specific section in Appendix C.
Sorry, Gordean, no offense intended. I seem to have misread your posts and badly garbled my responses (old age creeping in I am afraid). You are correct. Let me see if I can redeem myself -- please see my XHTML 1.0 Problems thread. James