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.

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!