I noticed that some inputs end with a closing tag /> and with >. Is there a reason why? When I test the code with /> and > tag I don't see any differences. Is it maybe that some people are forgetting to add the closing tag? It makes sense to me to use a /> closing tag at the end of every input.
Asked
Active
Viewed 38 times
1 Answers
0
the convention is or was if there is an opening and closing tag you don't use the / example is
<body>
</body>
if the tag is self-closing it is included by convintion.
<br/>
however, this changes based on the doctype declared and input is a bit of an exception:
in HTML 5 input with the slash is fine either way but in HTML 4.01 it is invalid to add the slash.
hope that helped!

CR Python
- 146
- 6