Step 6 of 8.1.2.1 Start tags of the HTML5 spec says that void elements may have a single /
character. I think this is so it\'s easier to migrate sites
Mostly it depends if you want to go the XML route or not. Both should render correctly, as the HTML5 spec does not require self-closing tags - their only reason is that the document is then valid XML.
The easier way is to probably just write then without the self-closing "/", unless there's a specific need to get the markup parsed as XML - in that case you also need
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
Closing the tag with a slash is a more explicit way of denoting that it is not meant to have a closing tag.
This article explains the difference between the two versions: http://www.colorglare.com/2014/02/03/to-close-or-not-to-close.html
The two versions are completely identical.
Actually, one might argue that adding "/` to a void tag is an ignored syntax error.
Google suggests in its style guide: do not close void elements.
HTML5 (HTML syntax) is preferred for all HTML documents ... Although fine with HTML, do not close void elements
Personally I've gotten used to closing tags with a slash, and find that />
helps me to recognize that the tag will not have a closing tag.
There is no consensus on best practice, and according to the author of the spec, Ian Hickson, it does not matter.