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 trialDouglas Thompson
384 PointsHead 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
Jeremy Lindstrom
6,646 PointsIt needs to be
<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>
Agapito Cruz
21,486 PointsHello Douglas, I think your head and body tags should be inside the html tags for it to work.
Hope this helps. -Agapito
Douglas Thompson
384 PointsThat's what I did wrong. Thanks!
Dustin Matlock
33,856 PointsHi Douglas, did you also include the <body>
element? We can take a look if you post your code.
Douglas Thompson
384 Points<!DOCTYPE html>
<html></html>
<head></head>
<body></body>
Kez Khou
3,903 PointsHello @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.