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

Erica Woods
Erica Woods
416 Points

It keeps saying, a title element needs to appear between the <head> and </head> tags, which I have done. Why am I wrong?

my code: <!DOCTYPE html> <html> <head> <meta charset="utf-8" <title></title> </head> </html>

Isn't my tile in between the <head> and </head>? Why am I wrong?

index.html
<!DOCTYPE html>
<!DOCTYPE html>
<html></html>
<html>
  <head></head>
  <body></body>
</html>
<!DOCTYPE html>
<html>
    <head>
      <meta charset="utf-8">
  </head>
  <!DOCTYPE html>
  <html>
    <head>
      <meta charset="utf-8">
      <title></title>
    </head>
    </html>

3 Answers

Nick Yoho
Nick Yoho
6,957 Points

You have too much extra code at the top

  <!DOCTYPE html>
  <html>
    <head>
      <meta charset="utf-8">
      <title></title>
    </head>
  </html>
Erica Woods
Erica Woods
416 Points

Thank You! I'm new to this and didn't know I would have to delete the code after a new question. Thanks again!

Nick Yoho
Nick Yoho
6,957 Points

No problem! It wasn't passing because it saw the <head></head> at the top first and read it as incorrect, it never had a chance to read the correct code at the bottom

Yeah you only need the <!DOCTYPE html> and the <html> once, then after you put in all the other code (head, body, etc.) then you put the </html> closing tag. Hope that made it seem a bit less complicated.