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 trialSwan The Human
Full Stack JavaScript Techdegree Student 19,338 PointsWhy 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
231,236 PointsPutting a slash (a "backslash" goes the other way \
) 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.
Swan The Human
Full Stack JavaScript Techdegree Student 19,338 PointsSwan The Human
Full Stack JavaScript Techdegree Student 19,338 PointsAwesome! Thanks, Steven Parker! Subtle detail I wanted to enquire about. Have a great night!