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

CSS Treehouse Club: CSS My First Web Page New HTML Features

why doesn meta tags don't have a closing tag ?

meta tags don't have a closing tag ? have no idea why ?

2 Answers

Kevin Korte
Kevin Korte
28,149 Points

It's just the way the html specifications are written by the w3c. My guess is because meta tags only use attributes, there is no need to have required a closing tag.

Actually, here it is from the w3c. A void element is an element whose content model never allows it to have contents under any circumstances. Void elements can have attributes.

https://www.w3.org/TR/html-markup/syntax.html#void-element

And the specifications for one of the more common meta tags, you can see in the tag omission part where it explains it. https://www.w3.org/TR/html-markup/meta.charset.html

Thank you Kevin Korte