Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website Customizing Colors and Fonts Write Hexadecimal Colors

How do I set the color of paragraphs to black using hexadecimals values?

I'm not sure how to do complete this challenge. I don't see where video discussed setting color of paragraphs nor creating black with hexadecimals. I tried the following but it didn't work.

p1, p2 { color: #000; }

3 Answers

p1 and p2 aren't valid html elements.

p {
    color: #000000;
}

I haven't done that challenge, but the code above changes paragraph elements to black text.

thanks

Gary Hurd
Gary Hurd
17,533 Points

HI Adam, I would just use the following:

p[ color:#000; }

For white and black, you can use the abbreviate hex for those colors. It save a little time typing. White would be #fff and black is #000

g

thank you.

Gary Hurd
Gary Hurd
17,533 Points

If you had a specific paragraph that you wanted to have a certain color on, you can give that paragraph a class and us that class attribute with to only color that particular paragraph.