4

Is </br> still an accepted HTML5 tag?

I got the impression that is not so used anymore and there should be something more modern that replaced it.

What should I use instead to be HTML compliant?

  • 3
    You intend `
    `, I suppose...
    – Andrea Salicetti Feb 19 '14 at 09:48
  • 1
    Positioning elements with CSS is generally the done things these days, but there is still some use for the ol'
    - Use away my friend! You'll no doubt get some CSS fanatics saying it's evil and the like, but it's personal preference, really.
    – laminatefish Feb 19 '14 at 09:49
  • possible duplicate of [HTML 5: Is it

    or
    ?](http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br)
    – Andrea Salicetti Feb 19 '14 at 09:49
  • 2
    it all depends on what you are trying to achieve. when would you like to use `
    ` for as it is?
    – Stefan Fisk Feb 19 '14 at 09:49
  • just a new line break –  Feb 19 '14 at 09:50
  • I think that if you're just using the one `
    `, possible two, just for breaks in text, then it's fine. Just don't go using it to create about 200px of space between two elements!
    – SaturnsEye Feb 19 '14 at 09:51
  • Already answered [http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br][1] [1]: http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br – Rakesh Kumar Feb 19 '14 at 09:52

6 Answers6

1

Simply <br> is sufficient.

The other forms are there for compatibility with XHTML; to make it possible to write the same code as XHTML, and have it also work as HTML. Some systems that generate HTML may be based on XML generators, and thus not have the ability to output just a bare <br> tag; if you're using such a system, it's fine to use <br/>, it's just not necessary if you don't need to do it.

Very few people actually use XHTML, however. You need to serve your content as application/xhtml+xml for it to be interpreted as XHTML, and that will not work in IE (it will also mean that any small error you make will prevent your page from being displayed, in browsers that do support XHTML). So, most of what looks like XHTML on the web is actually being served, and interpreted, as HTML. See Serving XHTML as text/html Considered Harmful for some more information.

Jebasuthan
  • 5,538
  • 6
  • 35
  • 55
0

</br> is invalid. It should either be <br /> or <br>. For HTML5 it is the best to just use <br> but I'm pretty sure it doesnt matter when looking at the validator.

Arko Elsenaar
  • 1,689
  • 3
  • 18
  • 33
0

This link http://www.w3schools.com/tags/tag_br.asp

Mentions that there is no difference b/w HTML 4 and HTML 5 regarding the BR tags.

0

In HTML5, for convention, is better to use <br>, in HTML you can use <br> and <br />, </br> is invalid in HTML and HTML5.

Donnie Rock
  • 552
  • 1
  • 14
  • 27
0

please refer the link

HTML 5: Is it <br>, <br/>, or <br />?

it has better description on it.

Community
  • 1
  • 1
Dexter
  • 4,036
  • 3
  • 47
  • 55
0

There is no info on <br> tag being invalid in HTML5 spec (I read w3.org and mozilla developers). The only deprecation notice i found is the clear attribute, but it doesn't really matter, as it was rarely used anyways.

The only thing about the usage of <br> tag - you should only use it for typography reasons - to provide line breaks inside a text. You absolutely should not use <br> for layout reasons - use display: block elements instead. Also you shouldn't use multiple <br> tags, and go for margin or padding css properties.

Other than that it's still perfectly valid element. It's used not too often because <p> is better suited for text style, but sometimes line break without margin is ok too.

Eternal1
  • 5,447
  • 3
  • 30
  • 45