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 trialLee Ann Merrill
1,103 Pointswhat is the html tag for?
I don't think I missed this in the video - what is the HTML tag for/what does it do? If you've already stated the document is HTML in the doctype why do you say it again?
4 Answers
Jennifer Nordell
Treehouse TeacherHi there! The <html>
tag is the "root" element of the document. All elements inside the document are considered to be descendents of this tag. It's not strictly required but is considered best practice. You might want to take a look at the MDN documentation for more information. Hope this helps!
Declan Ward
2,008 PointsHi Lee I might be a bit late to the party, from what i see you have declared the doctype as html so the browser can jump straight into decoding it. Then you 'open' said document with the tag <html> and close it at the very end with </html> after writing all the other bits in between.
A web writers 'Once upon a time...' and 'The End' so to speak :-)
Joseph Dunleavy
4,491 PointsI believe its an optional tag. Just best practices to include it. Google it ?
Paula Mourad
5,154 PointsHello Lee Ann!
The html tag declares that your document is in fact an html file. I could be wrong, but I believe that's the reason. :)