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

Where do I put the style tag?

Where do i put the style tag, i had input everything correctly

index.html
<body>
    <h1> {
      </style> 
  Color: orange;
      } 



      Nick Pettit</h1>
</body>

3 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

It looks like you have some mismatched tags. The opening <code><</code>style<code>></code> tag is missing. Let's walk through the challenge. The HTML comments in examples are for illustration only and are not needed for the challenge.

In Task 1 it asks you to Add a <code><</code>style<code>></code> element just above the <code><</code>h1<code>></code>. In a straight-forward way this can be done as follows:

<body>
    <style></style> <!-- open and close style tags -->
    <h1>Nick Pettit</h1>
</body>  

In Task 2 it asks you to Now, write CSS that will select the h1. Don’t forget your curly braces!. Inside the new <code><</code>style<code>></code> tags, add a CSS selector for h1:

<body>
    <style>
      <!-- h1 selector -->
      h1 {
      }
    </style>
    <h1>Nick Pettit</h1>
</body>  

Finally, Task 3 asks you to set the color of the h1 element to green.

<body>
    <style>
      <!-- set green color -->
      h1 {
        color: green;
      }
    </style>
    <h1>Nick Pettit</h1>
</body>  

Hello!

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
h1{

 Color: orange;
     }
</style>
</head>

<body>

<h1>Nick Pettit</h1>

</body>
</html>

You need to put style tags in head or you can use separate style sheet like style.css as your external style sheet. External style sheets are helpful you can use those for several pages. The style in head tag is only good for that current page. Hope it will help Happy coding :)