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 How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

Valentyna Shlonchak
Valentyna Shlonchak
1,515 Points

I cannot complete the task.

Hi, I cannot complete the task. what do you mean by: Nice! Finally, set the color of the h1 element to green.

<body> <style>

h1
{  
  color:green;


}
<style>
<h1>Green</h1>

</body>

isn't the above correct?

Thanks!:)

4 Answers

Your css code is correct, but you did not wrap the css code in a style element properly.

The style element needs to open and close like most other elements.

<style>

body {
 background-color: white;
}

</style>

<!-- My css selector targets the body element below --> 

<body>
</body>

Hi Airrick,

You Style needs to be in head section . just a heads up :)

Airrick Dunfield
Airrick Dunfield
18,921 Points

Thanks Muhammad, I tried in the Challenge mentioned in the questions and for that example and it needed to go directly above the h1 element

http://teamtreehouse.com/library/write-a-css-selector-and-property

No it doesn't.

Airrick Dunfield
Airrick Dunfield
18,921 Points

Leo's is a great answer and the proper one. I just went through the challenge and the following worked. Althrough, Leo's set is what you will want to do while creating any website.

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