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

Raeed Sabree
Raeed Sabree
10,664 Points

how to set the color of paragraphs to black with hexidecimal

for my quiz

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

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

#logo {
  text-align: center;
  margin: 0;
}
h1,h2 {
color: #fff;
}
<p>{
color: #000;
}
</p>

2 Answers

Julien riera
Julien riera
14,665 Points

Yeah,

You only use the ">" and "<" in your html file. Like : <p>, <body>, etc. Your css file will only understand what's inside these signs, such as p, body, etc.

That said, you only have to write :

p {
color : #000000 ; 
}

(or #000, as double numbers can be reduced as 1 number, for instance :

  • #224499 <=> #249
  • #771100 <=> #710

Just be aware that it only works for theses pairs of number, the following would be wrong :

  • #122337 <=> #1237
  • #333999 <=> #39 or #3399

This above, is a big mistake.

I hope this is clear.