The /
is only required for XHTML & XML.
If you're using a HTML5 doctype, then there's no need to terminate self-closing tags in this way.
This applies to <img src="img.png" />
, <br />
, <hr />
etc.
I.e. Just use <img src="img.png">
, <br>
and <hr>
.
If you need an empty element (like a div
), don't use <div />
, instead use <div></div>
. This is important since in HTML5, the slash is ignored and <div />
is interpreted as <div>
without a closing tag.