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

I'm having trouble understanding the task of changing the h1 tag from blue to green? Do I write the same code below it?

I tried writing the h1 tag again using a CSS selector and then writing green for what color to change and use. I wrote this on the same line as the original h1 tag and CSS selector was written on. Then I tried writing the same code on different lines below the original h1 tag and CSS selector were written on.

index.html
<body>
  <style>
    {
    h1 color: blue;   
    } 
  </style>
  <style>
    {
    h1 color: green;
    } 
  </style>
    <h1>Nick Pettit</h1>
</body>

2 Answers

Mark Buckingham
Mark Buckingham
5,574 Points

Hi,

your syntax is wrong the h1 selector needs to be outside of the braces:

h1 {
color: green;
}

Thanks

Ali Amirazizi
Ali Amirazizi
16,087 Points

You also don't need two separate style tags. You can put both in the same tag.

<style>
h1 {
color: blue;
}

h1 {
color: green;
}
</style>