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 How to Make a Website Customizing Colors and Fonts Write Hexadecimal Colors

Alejandro Martinez
Alejandro Martinez
5,074 Points

CSS- IM TRYING TO SET THE COLOR OF PARAGRAPHS TO BLACK USING A HEXADECIMAL VALUE. HOW CAN I DO THAT?

i must've missed it in the video. perhaps it goes something like this?

p { color: #222; }

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

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

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

h1, h2 {
  color: #fff;
}

paragraph {
  color: #222;
}

1 Answer

Patrick Olvera
Patrick Olvera
6,339 Points

Very close. The selector that CSS uses for paragraphs is the letter "p".

So instead of:

paragraph {
color: #222;
}

You should use:

p {
color: #222;
}

On a side note, the "color" property is used to color text. If you want to color the background of the paragraphs you need to use the "background-color" property. Also, #222 is a value for a shade of black with a slight white tint. If you are looking for pure black you want #000. Also the "p" selector will select all paragraph elements on the page, if you want to only select certain paragraphs you will need to use classes, ID's, or pseudo elements.

Alejandro Martinez
Alejandro Martinez
5,074 Points

ah! i was doing the color wrong then! got it! thanks for the response!!!!