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 Use HTML Elements

Robert bridges
Robert bridges
166 Points

What does it mean to "define your html doctype?

Stuck on test question.

index.html
<DOCTYPE html> 
  <h1>Tyler Bridges</h1>

2 Answers

Defining the document type means to define the type of document which you are going to write and its version. For using HTML and its version 5, here is the doctype:

<!DOCTYPE html>

And the rest of your html code must be within the html tags

<html>
    <!-- Your code --!>
</html>

And the code you want to display on the page must be within the body tags which is itself inside the html tags.

<body>
    <!-- Your code --!>
</body>

This is the most complete and correct answer.

Hi, Robert! It is my understanding that DOCTYPE just tells the browser which version of HTML you are using. <DOCTYPE! html> tells the browser that you are using HTML5.

This is also correct.