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

How do I set the color of the h1 element to green?

How do I set the color of the h1 element to green?

index.html
<style>
  h1{}
</style>
<h1>Nick Pettit</h1>

it's inline, so it will be <h1 style="color: green";>Nick Pettit</h1>

Duane Simer
Duane Simer
2,140 Points

It's actually not set up as inline in the given code - not that it matters; it can be inline, in a script tag, or linked to using a stylesheet.

3 Answers

Duane Simer
Duane Simer
2,140 Points

You want to use 'color: green;', though if you are looking for a specific shade, replace green with either hexadecimal or RGB codes. To get those codes, just google 'hexadecimal color picker' or something similar and you will find what you need.

Anthony Stapor
Anthony Stapor
3,369 Points

Hi, try this:

<style>

h1 {
 color: green;
}

</style>

You are doing a great job! However, you are missing the CSS code to set the h1 element to green. Hint :bulb:: There is a color property, and the code challenge wants you to set the value of that property to green.

Hope that helps!