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.

HTML How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property


I keep putting {color:green} but it is not working and I don't know what else to put

Stone Preston
Stone Preston
42,016 Points

can you post your full code. you may be using an incorrect selector

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

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

It still won't work :(

7 Answers

your code should look like this

    h1 {
        color: green;
    <h1>Nick Pettit</h1>

I think your missing the style tag or misplacing it

It worked!!! Thank you so much :) :)

Hahaha finally got there :)

Kevin Naegele
Kevin Naegele
10,868 Points

Are you putting a selector in front of your code? When you are writing your CSS you have to tell it what it is affecting ie: h1,h1,p,a... ex

here is an example

h1{ color:green; }

You have to add the style sheet then write the element aka the selector and then the property with a semi colon like so <style> h1 { color:green; } </style>

This should be within the body tag

Thanks so much!!!

No problem :)

Finally, set the color of the h1 element to green.

and this is what I've got!

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

Kevin Naegele
Kevin Naegele
10,868 Points

that looks correct. try removing the space between h1 and the {. but that is correct.

It keeps saying I'm wrong!!! :(

Is it in a style tag in the body ?