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 Build Structure

Separation of 'head' tags

How come with the 'html' and 'body' where separated, however the 'head' tags weren't

2 Answers

Hey Aaron! It's hard to really help you without your code and some extra information but I think I may know what you are struggling with.

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

</body>
</html>

If you're wondering why there isn't a space between the head tags but there is between the body tags then the answer is very simple! There could be 1000 lines of space or 0 lines and it wouldn't affect the code at all. If this is not what you needed help with then please respond with some more information.

Best of luck programming!

-Luke

Tommy Gebru
Tommy Gebru
30,164 Points

Any line of code meant to be visible on a webpage should be written within the body element <body></body>. Any code written within the head element is meant to contain information about the document and is not made visible with exception to the

<title></title>

the code written inside the title tags show up as the title of the browser tab.

This is the basic structure of an html page:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
The main part of the document goes here.
</body>
</html>

Hope this helps!

EDIT +1 for Luke Glazebrook