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

Jessica Pehrson
Jessica Pehrson
1,648 Points

how do you do this

im confused on what im doing wrong tried it 3 different ways and it still says im wrong

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

4 Answers

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hey Jessica,

You haven't explained your issue, but I am guessing you are struggling with changing the text color of your paragraph elements?

There are three issues with your css here.

  • Firstly you don't need a hash tag (pound, #) before the paragraph identifier. You only need a pound sign for id's and a period for classes.
  • Secondly, you need to put a pound sign (#) before your hexadecimal code for the black color.
  • Lastly, a hexadecimal color code should have 6 characters or numbers in it and yours has 5. With colors where it has 6 of the same character or number, you have shorten it to 3 characters like #FFF or #000.

Your css should end up looking like this:

p {
  color: #000000;
}

or

p {
  color: #000;
}

Hope this helps

Jessica Pehrson
Jessica Pehrson
1,648 Points

how do you add a hover element and make it a certain color?

Chris George
Chris George
10,740 Points

to select paragraph elements, there should be no '#' symbol, as that is only used to select elements with a specific ID. Also, you forgot the '#' symbol for the color. It should look like this:

p { color: #000; }

Jessica Pehrson
Jessica Pehrson
1,648 Points

thank you for youre help :) im having trouble remembering how to add color to a hover element and the right way to create a hover elememnt. if you could remind me the correct way to do that, that would be great

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Jessica Pehrson,

You are really close with your hover state.

There shouldn't be any space between the identifier and the :hover pseudo-class.

Your code:

nav :hover { color: #32673f }

Should look like this

.nav:hover { color: #32673f }

I am also guessing that nav is a class in your html? If this is the case, then you need to put a period (dot/full stop) in front of the class name like in my example.

Another example to help explain it.

HTML like this:

<div id="hero-header"></div>

<h3 class="header-level-3"></h3>

<p>My Paragraph</p>

The css to target these different html elements would look like this:

#hero-header {
    font-size: 25px;
    color: #000;
}

.header-level-3 {
    font-size: 18px;
    color: #000;
}

p {
    font-size: 12px;
    color: #000;
}

Notice the different selectors I am using. A pound sign for the id selector, a dot (period) for the class selector and the element selector uses just the element's name (in example 'p' for paragraph element.

Hope this helps, keep up the good work.

Mate Maksan
Mate Maksan
2,395 Points

you are missing # in front of 00000, it should be color: #00000

Jessica Pehrson
Jessica Pehrson
1,648 Points

nav :hover { color: #32673f } isnt working can you tell me what im doing wrong