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

setting color a paragraph to black

how do l set color to black on a paragraph

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: 000000;
}

2 Answers

/* all paragraphs*/
p {
  color: black; 
}

/* paragraphs with class paragraph*/
.paragraph {
  color: red;
}
<p>my content</p>

<p class="paragraph">my content with class</p>

You can also use the hexadecimal value of (short) #000 (long) #000000 instead of the word black. In your code sample you are missing the pound (#) sign.

millogt
millogt
7,644 Points

First u need to use the right selector for paragraphs. U use #paragraph but u should just use p to target all the paragraphs in the html file. Next u need to use the hexadecimal value for black to set the paragraphs to black. This is #000000 or #000 in short. If u are not sure about the code for a color u can just google it. Don't forget the # sign.

p {
color: #000;
}

Good luck!