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 Treehouse Club: HTML Publish a Story Body, 1st level headline, and style tags

How to properly add the <h1> in the HTML

is it <h1>Once Upon a Time</h1>

index.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
  <title>Once Upon a Time<body></body>
    <style>
         {text-align:left; color:green}
      <body> <!-- * -->
          <h1>Once Upon a Time</h1> <!-- * -->
      </body> <!-- * -->
    </style>
</head>
    <!-- move * to here -->

</html>

2 Answers

Hi there,

You need to move your body tags to after the closing head tag. Your h1 then goes inside the body.

Make sense?

Steve.

I added come asterisks & comments in your code to show you what to move where.

Not quite sure what you mean

OK, let me try to explain.

You start the challenge with this code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Once Upon a Time</title>
    <style>
        h1 {text-align:left; color:green}
    </style>
</head>



</html>

The challenge asks you to Start by writing an opening and closing body tag below the closing head tag, and above the closing html tag.

So, that code needs to be inserted where I've indicated below, i.e. after the closing head tag, </head>:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Once Upon a Time</title>
    <style>
        h1 {text-align:left; color:green}
    </style>
</head>

<!-- HERE!! -->

</html>

You have added the body tag inside the style part of the html code.

You have written the correct code with this:

      <body>
          <h1>Once Upon a Time</h1>
      </body>

But you have put it in the wrong place. Move that block of code to where I wrote <!-- HERE!! --> and your code will work.

Steve.