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 How to Make a Website HTML First Build Structure

Fung How Lim
Fung How Lim
2,402 Points

!DOCTYPE and HTML - puzzling!

Hi Treehouse; newbie here. It's been great learning from you guys, keep up the good work! :)

There's one thing i didnt quite understand from the video.. What is the point of putting !DOCTYPE and HTML in the code?

It is stated that DOCTYPE is used to communicate with the browser.. letting it know that it's a document. If your website has video, does this mean that DOCTYPE will not be used? if DOCTYPE is not coded, does this mean that the page wont show up in our browsers?

Sorry for the wall of text. I am really confused - yet psyched! Looking forward to your reply.

3 Answers

Ben Attenborough
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ben Attenborough
Front End Web Development Techdegree Graduate 32,769 Points

There are different version of HTML out there so by declaring <!DOCTYPE html> you are explicitly telling the browser this is a html5 document. This is important because some features may be interpreted incorrectly if you do not add this to the top of the document. For more information see: http://www.w3.org/QA/Tips/Doctype

Basically DOCTYPE is the version of html you are using which means html5 there are other versions

Fung How Lim
Fung How Lim
2,402 Points

Thanks for the link! Appreciate it!