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

Annika Song
Annika Song
2,033 Points

how can u add "Once upon a time" to the text? its really frustrating

ddd

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

    </style>
</head>

  <body> blablabla </body>

</html>
Ben Sohl
Ben Sohl
5,670 Points

Your h1 tag needs to be inside the body tag. It should look like this:

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

1 Answer

Nathaniel Evans
Nathaniel Evans
14,205 Points

Ben Sohl is right, you're including the <h1> tag in your head. The head does not - to my knowledge - display in the main body of the page.

It needs to be inside the <body> tags, like below:

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

  <body>
     <h1> Once upon a time </h1>
  </body>

</html>