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 Treehouse Club: HTML Publish a Story The Head

Lee Ann Merrill
Lee Ann Merrill
1,103 Points

what 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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles:

Declan Ward
Declan Ward
2,008 Points

Hi 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 :-)

I believe its an optional tag. Just best practices to include it. Google it ?

Paula Mourad
Paula Mourad
5,154 Points

Hello 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. :)