0
I noticed that it is common to see some tag elements of the type Void with the 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 closure...
Ex:
<input id="author" name="author" type="text">
<input type="submit" id="pin-site-btn" value="Adicionar" disabled="disabled"/>
From what I saw, it seems that in HTML5 the Browser ignores this / in tags that do not need to be closed like the above. (Different from Div for example that should be closed <div>...</div>
)
So if the browser ignores this, and if the use is not mandatory, why is it so common to see void-Elements closed in this way / > for no apparent reason?
NOTE: In Materialize, in HTML Configuration, you have <link>
with and without / > http://materializecss.com/getting-started.html
Reference W3C Void Elements: https://www.w3.org/TR/html5/syntax.html#void-Elements
Actually it’s the other way around, the
/>
is a "practice" in Html4x and not HTML5, so if in the future it gives any problem is the fact that it is using. The HTML recommendation is that you don’t use it, yet we find this lock everywhere...– hugocsl