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 trialNikolay Zhdanov
152 Pointswhats a doctype?
whats a doctype?
<h1> <head> Nikolay
</head> <header> designer </header>
</h1>
2 Answers
Harry Jones
2,964 PointsThey explain Doctype in a video, but as far as I can tell, it's a way of telling the website what language to use. For example, HTML would be the doctype HTML, telling the website that's what you want to use.
Mindy Sandilands
15,743 PointsHere's an explanation from W3schools.com
Definition and Usage The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag.
The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.
In HTML 4.01, the <!DOCTYPE> declaration refers to a DTD, because HTML 4.01 was based on SGML. The DTD specifies the rules for the markup language, so that the browsers render the content correctly.
HTML5 is not based on SGML, and therefore does not require a reference to a DTD.
Tip: Always add the <!DOCTYPE> declaration to your HTML documents, so that the browser knows what type of document to expect.
For this example you would want to always have the following declaration at the top of all your HTML documents. <!DOCTYPE html>
Hope this helps.