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

Unable to change style color from blue to green. Code worked for blue but not for green. Why?

Don't understand why just changing the text caused the code to fail. If blue worked, then changing to green should also work, right?

index.html
<style>
  {
    h1 color: green;
  }
</style>
<h1>Susan Dubickas</h1>

2 Answers

Julie Myers
Julie Myers
7,627 Points

Your css syntax is a bit off:

// This is what you have:
  {
    h1 color: green;
  }


// This is what is needs to be:
h1 {
 color: green;
}

Hi Susan,

The structure of your code is wrong, that's all.

You want to make a structure like this inside your 'style' tags:

h1 {
   color: green;
}

Hope that helps,

Ede