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

HTML Basics Forum

View Course

148 points
Bf84e9c50cfe4fd0a1613da68f1d19d4?s=140&d=retro
Submitted by
Nicole
over 3 years ago

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

<img src="http://i1061.photobucket.com/albums/t480/ericqweinstein/f3a16fb6.jpg" />

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

permalink

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
1971df3750371cbdda4c08ad10b40030?s=140&d=retro
Submitted by
Alex J
over 3 years ago