+ 7
<br /> vs. </br>
What is the difference of this two? i've seen that in the lesson they use <br /> for single line break? But i saw </br> in the comments what is it for?
4 ответов
+ 8
The shorthand syntax explained by @Volker Milbrandt is not valid in Html5 ( even uf browsers try to correct it )... it is a XML shorthand rule ^^
As it's only in XML that you use the <xxx/> form for not container tags: in Html5 this form IS NOT valid.
So, <br> or <hr> and so on such tags is the only valid syntax. A lot of coders keep the habit to use the <xxx/> form, because it was valid in previous version of Html ( and mandatory in XHtml branch ), but they have to lose it ;P
+ 2
</br> is wrong syntax.
+ 1
I think <br /> is for HTML5 and </br> is for old html version.
0
</xxx> is always the closing tag of <xxx>. The form <xxx /> is only an abreviation you can use if there is nothing you want to include between these enclosing tags. For example <p /> is an empty paragraph whereas <p>some text</p> has „some text“ included.
Thus you might write <br /> or <br></br>.