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

Set the color of paragraphs to black using a hexadecimal value.

Set the color of paragraphs to black using a hexadecimal value.

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

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

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

h1, h2 {
  color: #fff;
}

2 Answers

Adam Hirschovits
Adam Hirschovits
4,983 Points

Hi Delwayne

The code would be:

p { color: #000; }

the "p" targets the paragraphs, whereas on the next line, the "#000" sets the colour. Note that "#" tells the computer that you are using hexadecimal values. The three following numbers set the actual colour. Entering 000 is the same as entering "000000", on the basis that the first two letters select the red element, the next two the green element and the final two the blue element. Given that all the values are the same (i.e. 00 as opposed to, say, 01), you can short-hand each colour reference on the basis that they use the same numbers, hence 000000 becomes 000.

Hope that helps!