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

Head tag

I'm on this code challenge. It asks me to write a head and body element. I created a head element by typing in <head></head>. It still tells me that I didn't write a head tag. I don't get it

5 Answers

It needs to be

<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>

Hello Douglas, I think your head and body tags should be inside the html tags for it to work.

Hope this helps. -Agapito

That's what I did wrong. Thanks!

Hi Douglas, did you also include the <body> element? We can take a look if you post your code.

<!DOCTYPE html>
<html></html>
<head></head>
<body></body>
Kez Khou
Kez Khou
3,903 Points

Hello @DouglasThompson , the code Jeremy Lindstrom posted is correct. To clarify why you're code wasn't working is because you did not structure your html page correctly. Even though you technically completed the tasks that the code challenge asked for, the code challenge is assuming that you know to always, always, always structure your html correctly.

Take note of how Jeremy's code has the open and closing body tag, and head tag, enclosed within the opening and closing html tag.