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 to make website help required

how set the color of the h1 element to green

2 Answers

Stéphane Diez
Stéphane Diez
19,350 Points

You have a lot of ways to do that. To do this with a class see this:


<h1 class="color">Your Text</h1>


.color{ color:green; }
Ben Morse
Ben Morse
6,068 Points

If you don't want to use an external file, you can use an inline style.

<h1 style="color:green">Hello World</h1>

but Inline style isn't used much because it is not a the best practice when it comes to coding/maintenance work. Only used for testing purposes. Best of luck Coder.