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

CSS How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

We didn't learn anything about <body> and then when we got to the challenge, it said to use <body>?

I don't know what the <body> was for because we didn't learn about that. It would be helpful to tell us about it before it asks us to use it. I had all the code correct but didn't have <body> as I didn't know that was needed or what it is and does.

index.html
<body>
  <style>
    h1 {color:blue;}
  </style>
    <h1>Melissa Kasper</h1>
</body>

2 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

The body tag is part of the basic html document structure, and is required to be valid html. Browsers will attempt to display content that is improperly formatted, however. In any case, all html documents will have this basic structure:

<!DOCTYPE html>
<html>
 <head>
  (Your head tags, including links to style sheets and meta tags)
 </head>
 <body>

  (The rest of your content)

 </body>
</html>

Thank you. I was more confused why they didn't explain it before we were asked to use it. I thought they could look at this, sorry!