0
How canny close a tag after opening <img src>
3 Respostas
+ 2
img is self closing, you can - but don't need to - write <img src="image.png" />
the slash at the end isn't necessary. if I'm not mistaken, it was recommended in HTML4, but it's obsolete in HTML5. I'm not sure about that.
+ 2
The requirement of ending slash ( / ) in self closing ( empty ) tags was only for XML branch of Html ( XHtml)...
Syntaxe of Html is relatively permissive ( because based on SGML, as XML is too, while XHtml is based on XML ), so browsers accept it, but that's not valid code: it must be avoided ^^
0
image tags do not need a closing tag. They are closed with a / before the > like so <img src/>