dont know, i always tend to use <br/> but from time to time forget the /. Never really had any problems though.
<br /> is only used in XHTML programming. For example HTML - Hello World <br> Bye XHTML - Hello World <br> Bye <br /> It's just a closing tag.
XHTML is html reformulated as xml. XML requires that all tags be closed. Some tags in html are empty, that is they are replaced by whatever they're tagging. For example the <img> is replaced by the actual image, <br> is replaced by a line-feed, and <hr> is replaced by a horizontal line. These tags have no closing tag in html. XML allows a short-hand for empty elements, the /> mechanism; thus, <br/>. That's good for xhtml, but invalid for html[1]. HTML does allow it, though, if there is a space before the virgule, /. So <br /> fulfills the xml requirement, while being html valid. Using something like <br></br> would be invalid, as the closing tag is prohibited, and <br><br /> is redundant in html and invalid in xhtml. cheers, gary [1] Since IE does not support xhtml, we are usually forced to serve our xhtml pages as text/html, thus the little hack.
Good explaination kk5st, as a rule I always (and should everyone I think) use <br /> for line breaks. It's a good habit to be in.
To anyone that doesn't understand <br> versus <br /> <br /> is a self-closing tag. Just like <img src="" width="" height="" alt="" /> an image tag is self-closing meaning that it doesn't require an open/closing tag surrounding it's contents. I like coding in XHTML, does it matter at the moment? Hell no, but it works better in the fact that modifications are easier when following the rules/standards set by the W3C. Either code fully in XHTML or not at all. Either fully use CSS or not at all, simple as that. The above is my opinion, not stating facts. - Take it as you will. Read w3C's documentation... seriously, it will tell you good/bad things about the standards that are set. - Rob Docherty - www.interceptdesigns.net - www.thelouisvilleseo.com
xhtml.. got to get in to that.. first sat that </br><br> i swore he got that backwards.. nice answers.. learned something
In summary: If you were writing in XHTML, you would write <br></br> ...OR... <br /> If you are writing in HTML and want to prepare for XHTML, write: <br /> This applies to all tags that in HTML don't need to be closed like <IMG> and <HR>. BTW, if you are the kind of foreseeing person, it is better to write all tags in lower-case as this is mandatory in XHTML.
HE EHEH. I use <br> only to save a stroke on my keyboard and may be till I am finished with this programming and webdesinging. I will save enough keystrokes that would make a new project. And maybe that project would also sell for some $$$'s
in firefox and ie.. if you compare.. <br> </br> - gives more space too. <br/> - give less spacing [- is xtml self closing tag]
What part of "end tag: forbidden" don't you understand? At some point, one must RTFM. http://www.w3.org/TR/html4/struct/text.html#edef-BR gary
Well. Also, if you use the fixit tool in html kit it will close all your line breaks for you using the xhtml tag!
And, wrong. RTFM[1] gary [1] The construct <br></br> would be allowed if you were serving the xhtml document as xml, i.e. application/xhtml+xml or one of the other allowed but not prefered xml MIME types. The closing tag is specifically prohibited in html. If you don't serve it as html, IE can't render it.
>><br /> is only used in XHTML programming. For example >>HTML - Hello World <br> Bye >>XHTML - Hello World <br> Bye <br /> In XHTML, <br /> is a shorthand to not use <br></br>. It is used by itself and not as a closing tag.