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

Am I really this dumb, or is something broken? Can't pass code challenge on basic css...

It is asking me to set the color of the h1 element to green. I entered this code:

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

    <h1>Nick Pettit</h1>
</body>

When I check it, it says, "Bummer! Make sure you're coloring the h1 tag green."

Did I miss something?

5 Answers

Hi Frank,

Not at all. Just a slight change for the placement of the opening brace. Instead of:

{h1 color: green; }

try:

h1 {color: green; }

So h1 is the element and everything within the { and } are the styles you want to apply to it.

Hope that helps.

-Rich

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points

You're not thick. :-)

You've almost got it.

Try

h1 {
 color: green;
}

CSS rules are made up of selectors, keywords and values.

h1 selector {values}

Good luck. :-)

Arrgh. Guess I was being THAT dumb. LOL. That's what I get for taking a few days off. Thanks guys.

BTW, how do you make the "Backticks" to indicate code on the forums. I gave up and copied and pasted them. LOL

Hi Frank,

Easy mistake. Don't worry, it'll become easier the more you do it.

Backticks are to the left of the Z key (on my Mac anyway). Think they could be to the left of the numbers on other keyboards though.

Thanks

-Rich

Found them. Thanks again.

No problem :)

Hi,

And dont worry Frank Horbelt , everyone makes mistakes, even the masters of the subject makes easy mistakes.
Remember , failiture is your friends because you learn from it ( im sure you heared it a lot of times ) but you need to look at it and see what you did worng.

If you are just starting , it will be probably hard and frustrating. But don't give up, even if you dnt understand, just do it, eventualy you will. Get throw the basics and the rest will come naturaly and you will improve with time. just don't quit.

Hope this gets you in a good mood :smiley:

-Aurelian