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 Comments and Doctype

Samantha Hagar
Samantha Hagar
805 Points

What's the purpose of the <html>?

What's the purpose of the html after the Doctype?

2 Answers

Stephen Limmex
Stephen Limmex
32,604 Points

The document type element tells the browser what kind of content to expect in a web page. In this case your are telling the browser that the document is a <html> document.

Don't we give the browser the same information before when we type at the beginning <!DOCTYPE html>?

The html element is the root of an html document where the document gets defined as an html document (telling the browser html is about to be used here). Once it's placed, all other elements are descendants of it.