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

Cant change the h1 line color

<style> h1 { color: green: }

</style>

<h1>Nick pettit</h1>

please explain what im doing wrong

index.html
<style>h1 {

h1  color: green:}</style><h1>Nick Pettit</h1>

3 Answers

You are referencing the h1 element twice, which is probably the reason it doesn't work. Here's how to do it:

<style>
  h1 {
    color: green;
  }
</style>

<h1>Nick Petitt</h1>

<style> h1 { color: green: } </style> <h1> Nick Petitt </h1>

ugh this is so stupid im typing the code in exactly as you did everytime i push enter the above comment only shows ??? what is that !!!

Meghan, this is the forums. You post topics and replies here. The coding is done on the actual course page. https://teamtreehouse.com/library/how-to-make-a-website/beginning-html-and-css/write-a-css-selector-and-property

Mochammad Rezza
Mochammad Rezza
4,778 Points

Hii Meghan Edmondson,<br> your code is false .<br>

<code>h1 { color: green: }</code> don't use colons after the green color, but use semicolons.<br>

the right code is <code>h1 { color: green; }</code>