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

2 Answers

Samuel Webb
Samuel Webb
25,370 Points

It's because you're using square braces [ ] when you should be using curly braces { }

Samuel Webb
Samuel Webb
25,370 Points

Also, the h1 as a whole shouldn't be between curly braces. Code should look like this:

<style>
  h1 {
    color: green;
  }
</style>
Loren Cardella
seal-mask
.a{fill-rule:evenodd;}techdegree
Loren Cardella
Python Web Development Techdegree Student 8,096 Points

The exercise immediately before this one forced me to put the h1 tag in curly braces. Doing it your way let me complete this exercise, but only after: 1) Putting h1 in curly braces in the previous exercise 2) Deleting the curly braces in the current exercise 3) Adding curly braces around color: green;

Samuel Webb
Samuel Webb
25,370 Points

Not sure which part is making you use square braces. I didn't see anything.

First part:

<!-- Add style tags above h1 -->
<body>
  <style></style>
    <h1>Nick Pettit</h1>
</body>

Second part:

<!-- Select the h1 element -->
<body>
  <style>
    h1 {}
  </style>
    <h1>Nick Pettit</h1>
</body>

Step threee:

<!-- Set h1 color green -->
<body>
  <style>
    h1 {color: green}
  </style>
    <h1>Nick Pettit</h1>
</body>