This forum is now read-only. Please use our new forums at

HTML Basics Forum

View Course

148 points
Submitted by
over 2 years ago

Is the closing "/" necessary in tags that close themselves (like the image tag)?

<img src="" />

I've tried using this code without a closing slash and it's worked just fine. I've never learned to use a slash here; is this necessary?

0 votes


It's only necessary if you want your HTML to be XHTML-compliant – if you don't know what that is, you probably shouldn't bother. Browsers won't care.

3114 points
Submitted by
Alex J
over 2 years ago