Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 67,986 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>  
ellie adam
ellie adam
26,376 Points

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>
ellie adam
ellie adam
26,376 Points

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 :)