+ 3
Hey, What's the difference with <br> and <br />
seams they both have same outcome
7 Answers
+ 4
<br /> is the proper way of doing it. All HTML tags should be closed. So either the self closing <br /> or the less used <br></br> should be used. Browsers will often understand what it should render as without closing (just using <br>), but its bad code.
+ 3
<br> is the normal tag in all versions of Html, except in Xhtml branch, based on XML and requiring the final slash ( / ) in the tag, when shorthanding the complete paired form of empty content ( <tag></tag> is shortened <tag /> in Xml and Xhtml ). By extention, html syntaxic rules defined that tags not allowing content can avoid closing tag without adding the slash ( / ) at the end of the opening one as in Xml.
With Html5 and the abandon of the Xhtml branch, the <br /> form is deprecated, even if browsers still support them ( graceful of permissivity of Html/SGML based against the not one of Xhtml/Xml -- Xml is itself based on Sgml ^^ ). </br> tag, with the slash ( / ) at begin, is not valid by itself, even for same reasons than previously it was relatively supported ( means silently corrected ), and writing <br></br> isn't much valid in Html specifications ( so, always for the preceding auto-correction, this would be result to <br><br> in the display :P )
+ 1
<br> is the tag some tags like it doesn't have closing tag </br>
but some browser
still search for it so
<br/>is used
0
@John Smith
âJust to add my two cents about what I have come to know, the difference between <br/> & </br> is quite simple.
âThe tag <br/> was (and in some places still is) used in XHTML as it was the required syntax or language if you will of that tag The coding language XHTML is a branch off from the language XML that had a syntax rule that required all tags to be closed. In particular though, the <br /> tag is only really used for the sake of compatability with older browsers.
â However, when HTML5 came along the <br /> became obsolete from being a requirement from the syntax of br tags, thus you only need to write </br> in HTML5.
âIt is important to note & reiterate again however that when dealing with older browsers, you must used <br /> and NOT </br> otherwise it won't be compatible. So other than for the sake of an older browser you don't need to use it.
â Lastly just to throw this in here, XHTML (Extensible Hypertext Markup Language) is similar but different from HTML (Hypertext Markup Language).
0
but </br> stands for linebreak
0
<br> = ?
<br/> = linebreak