Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS Adding a New Web Page Test: Write and Style an Element

how do i set up my HTML site with my <!doctype> and <html>?

I am taking the test to start a html web page but i'm stuck I entered <!doctype> and <html></html> adn it keeps saying its wrong.

index.html
<e>
<html>
</html>

2 Answers

John Cotter
John Cotter
2,489 Points

Hi Tifara

<!DOCTYPE HTML>

<html>

</html>

Hope this helps and good luck

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

HI Tifara, like John posted the basic structure of a web page including the <!DOCTYPE>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Your Page Title</title>
  </head>

  <body>
    Your content goes here!
  </body>
</html>
  • <!doctype html> - This piece of code let's the browser know that asking it to display an HTML document.
  • <html> - All of your code must be between the html opening and closing tags.
  • <head> - Holds all the important behind-the-scenes information about your web page, like the title of your web page, and a links to a CSS stylesheets.
  • <meta> - This meta tag basically specifies which character set a website is written with.
  • <title> - Stuff between title tags doesn't appear on the web page, but you'll see it in search engine results and browser tabs.
  • <body> - Everything that displays in the browser - header, navigation, images, content - goes between the body tags.