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!

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


Self Closing Tag

In this video, Nick shows the first example and states its a self closing tag. So when i used both examples on a page with the self closing tag first and the second one showing multiple sources, the page loads only up to the point of the first video. If i add a closing video tag, </video> then both videos will display.
Is Video a self closing tag as stated?

1 Answer

Michael Collins
Michael Collins
3,447 Points

The video tag is not self closing. Generally tags are self closing if they can't contain content between them. E.g. <input />, <br />, <hr /> etc.

However, the video tag can contain content e.g.

    <p>Your browser doesn't support HTML5 video.</p>

Therefore, without the closing tag, the browser doesn't know where the content belonging within the <video> tag ends and the rest of the page content begins.