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

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

Stacey Fenton
Stacey Fenton
5,501 Points

How do you make the h1 tag green?

I have the following CSS code before the h1 tag (still in the body), but I keep getting errors: <style> h1 {color=green; } </style>

5 Answers

I just posted an answer on this form...

h1 tag green

Mike Stewart
Mike Stewart
4,984 Points

It looks like you have a syntax error. As Csaba said, try using a semi colon (:) instead of an equals, so it should look like this... h1 { color: green; }

Here is a combination that would also work.

External CSS h1 { color: green; }

Internal CSS - between the open and closing head tag < style > h1 { color:green; } < /style >

Inline css within html tags < h1 style="color:green;" > Text < /h1 >

Core HTML < h1 >< font color="green" > Text < /font >< /h1 >

Csaba Todor
Csaba Todor
3,753 Points

h1 { color: green; }

Stacey Fenton
Stacey Fenton
5,501 Points

These answers worked - thanks so much for the help!