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 Customizing Colors and Fonts Write Hexadecimal Colors

Jonas Eldi
Jonas Eldi
8,152 Points

Help me!!!!

I just can't figure out the answer to a question! I'm supposed to "Set the color of paragraphs to black using a hexadecimal code" but when i try it just won't work. I have tried many ways, and even on my own workspace the paragraphs become black when I use the same code, but in in the code challenge, they don't.. What am I doing wrong, or is there possibly an error with the challenge?

css/main.css
a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

#logo {
  text-align: center;
  margin: 0;
}

h1, h2 {
  color: #fff;
}

body p {
  color: #111;
}

6 Answers

Zach Patrick
Zach Patrick
19,209 Points

The hexadecimal value for black is #000; #111 would technically be a very dark grey.

The following answer is correct...

h1, h2 {
  color: #fff;
}

p {
  color: #000;
}
M. Cotter
M. Cotter
6,179 Points

Hi Jonas,

The code should read:

p {
color: #000;
}

because the hex value for black is #000000, or you could also write:

p {
color: black;
}

I hope this answers your question! If it did, please consider marking this as the Best Answer! :) If not, let me know what happens when you try this change, and I'll see what I can do to help.

M.

Richard Hope
Richard Hope
25,237 Points

You could try a six digit code??

Or it may be that #111 is not the shade of black they're after. Try using a lower number than 1??

This worked for me:

a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

#logo {
  text-align: center;
  margin: 0;
}

h1, h2 {
  color: #fff;
}

p {
  color: #000000;
}
Jonas Eldi
Jonas Eldi
8,152 Points

Wow.. guys you are lifesavers.. This challenge has bothered me for so long now.. Thanks a lot!! I must say I'm a little bit embarrassed right now!

Zach Patrick
Zach Patrick
19,209 Points

No problem! It just takes a little getting used to.

M. Cotter
M. Cotter
6,179 Points

No worries! It's one of those things that can be hard to figure out when you're in it, but is more clear to an outside eye. What ended up working for you?

M.

Jonas Eldi
Jonas Eldi
8,152 Points

The

p { color: #000; }

worked for me! Thanks again!

M. Cotter
M. Cotter
6,179 Points

Nice! Very weird that it wouldn't accept #000000, but glad it's now working for you!

Happy coding!

M.

Here's a page that has lots of hex colors in case you ever have the same problem. http://www.w3.org/TR/css3-color/#svg-color