I noticed that it's common to see some Void element tags with closing />
Ex:
<br />
<hr/>
<meta name="twitter:domain" content="pt.stackoverflow.com"/>
And right here in the StackOverflow source I found <input>
with and without tag closing ...
Ex:
<input id="author" name="author" type="text">
<input type="submit" id="pin-site-btn" value="Adicionar" disabled="disabled"/>
From what I've seen, it seems that in HTML5 the Browser ignores this / in tags that do not need to be closed like the ones above. (Unlike Div for example that should be closed <div>...</div>
)
So if the browser ignores this, and if usage is not mandatory, why is it so common to see void-elements closed this way / > for no apparent reason?
NOTE: In the same article, in HTML Setup, you have <link>
with and without / > link
W3C Void Elements Reference link