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 Introduction to HTML and CSS (2016) Getting Familiar with HTML and CSS Building Web Pages with HTML and CSS

Enemuo Felix
Enemuo Felix
1,895 Points

styles.css

I was wondering why the background color value /element(don't really know the correct term) was in numbers before Treasure changed them to 'blue' or 'white' when she was playing with the CSS. Formerly, it was a number, I think something like '#222'

1 Answer

Hi Enemuo,

It sounds like Treasure was using hexadecimal values for the color on the website. There are many ways to place color on a website including RGB(red, green, blue), CMYK(cyan, magenta, yellow, and black), and keywords like blue or orange.

Hexadecimal numbers can also be used to display color. The #222 is the short hexadecimal version of #222222. All hex values have the # and 6 numbers following the #. The hex number is considered 3 pairs of numbers, so if you have #ab2278, then ab is the first pair, 22 is the second pair, and 78 is the third pair. Since #222222 has three pairs of 2, it can be shortened to #222. Does this help?

Enemuo Felix
Enemuo Felix
1,895 Points

Great ! this helped a lot. Thanks