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

Bibek Khatiwada
Bibek Khatiwada
353 Points

Adding head and body element

i am placing the body element within the head element still it says be sure the head is before the body. what am i missing?

index.html
<!DOCTYPE html>
<html>
  <head>
    <body>

    </body>
  </head>
</html>

Hi Bibek,

Currently your body block sits inside your head block.

The head open and close tags form the HEAD of your markup, and likewise the body open and close tags form the BODY of your html markup. Hence they cannot be placed within each other. <head></head> <body</body>

Place them as blocks (a head block, then a body block). You will soon see the block concept being applied to other elements such as a section or div which reside inside a body block.

Hope this helps .

2 Answers

Think of your HTML like a person: head body (footer if necessary)

All separate parts of a whole

Bibek Khatiwada
Bibek Khatiwada
353 Points

Thanx Austin it helped