Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Swan The Human
seal-mask
.a{fill-rule:evenodd;}techdegree
Swan The Human
Full Stack JavaScript Techdegree Student 19,338 Points

Why is there a / in the <img> tag that Nick is using in this video?

In this video, Nick creates an <img> tag but uses a backslash in it (<img/>) even though it's a self closing tag. He uses this particular <img> in a multi line fashion. Is that the reason he uses the backslash at the end?

1 Answer

Steven Parker
Steven Parker
231,269 Points

Putting a slash (a "backslash" goes the other way :point_right: \ ) at the end of the tag is a more formal syntax (XML) to indicate a void tag (no contents and no end tag). It's optional in HTML.