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 trialVictor De Jesus
1,024 PointsCustomizing Colors and Font (Challenge)
I think I am stuck in a very easy part of the CSS challenge. I asks me to set the color of paragraphs to black in hexadecimal values.
This is what I wrote:
p { color: #111; }
Is this wrong?
6 Answers
Chase Lee
29,275 PointsPaul Barron, you don't need to use all six digits in a hexadecimal color code, what Victor used is a shortcut.
Victor De Jesus, you need to use #000
in your color code as it is the lowest number you can have, which is of course black.
Paul Barron
6,595 PointsI mean yes. #fff is the highest amount of color. Remember in science they said white is full of color and black is the absence of color well... #fff is white and #000 is black and #999 is grey because it's in the middle grey area if you will. The hierarchy goes like this from black 01234569abcdef to white. hope this helps.
Ron McCranie
7,837 PointsYou can use letters or numbers in the 3 character shorthand. All it says is if two consecutive numbers or letters are identical for that color (red, blue, green) then you can shorten it to 1. So #AABBCC
-> #ABC
and #EEFFAA
-> #EFA
Here's a good article that goes into depth about hex colors and how to break them down.
http://www.smashingmagazine.com/2012/10/04/the-code-side-of-color/
Victor De Jesus
1,024 PointsNice article!
Paul Barron
6,595 Points000000 hex=six you need 6 digits
Paul Barron
6,595 Pointsp { color: #000000; }
Victor De Jesus
1,024 PointsSo, when writing color in hexadecimal values, the only way to write them in 3 values is with letters. For example,
p {color: #fff;}
This will be white. Right?
Chase Lee
29,275 PointsCorrect. You can also do #384
which will equal #338844
.
Chase Lee
29,275 PointsLike in the example above, you can also write them in numbers.
Victor De Jesus
1,024 PointsVictor De Jesus
1,024 PointsThanks Chase. I forgot that the colors go from 0 to 9 and a to f.
Chase Lee
29,275 PointsChase Lee
29,275 PointsGlad to help.