3

Simple question. A basic horizontal rule, nothing fancy, no color, no size or width, no aligning, which is it... <hr></hr> or <hr/>.

I understand which of them work, but which is PROPER.

madth3
  • 7,275
  • 12
  • 50
  • 74
user2785803
  • 53
  • 1
  • 3

1 Answers1

9
  • HTML4.0: <hr>
  • XHTML1.0: <hr />
  • HTML5: both are accepted

While the above is a (small) argument in favour of HTML5 -- and similar for other self-closing tags such as <img /> -- organizations are likely to have coding standards in place. Also, for one's practice it is useful to pick one style and stick to it. Where HTML5's flexibility is useful is when including third party code that may be available only in one flavour, not both.

chryss
  • 7,459
  • 37
  • 46
  • 1
    html5 both are accepted but in professional environments they will want to stick to a standard. The shop I work for uses non self closing tag syntax for html5. `
    `
    – Kai Qing Sep 17 '13 at 01:26
  • This is a good point. I am editing my answer. – chryss Sep 17 '13 at 01:28