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

stuck on code challenge

How do you set the color of the a element inside the nav element?

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

4 Answers

stephanie sutedja
stephanie sutedja
3,693 Points

'''

nav a{ color:#fff; }

'''

Descendant Selector is made up of two or more selectors separated by white space. It helps the selector to be more specific.

Abraham Kan
Abraham Kan
4,588 Points

In your code, just add the color property, one line below the text-decoration line. Hope that helps

Anna Casey
Anna Casey
3,101 Points

In HTML you will have a lot more elements to write out and a very specific hierarchy that you need to follow:

<nav>
   <a>
       <p>This is just an example</p>
   </a>
</nav>

But in CSS, when you are referring to an element, that text for example, you write out the hierarchy in one line:

nav a p {
     text-color: #000;
}

So for your challenge since you are after the a element you need to list the nav element first:

nav a {
    text-color: #000;
}

Hi thank you so much but, for some reason it doesn't like the text-color and is underlining it. But here is what I put in my code.

nav a { text-color: #000; }

Anna Casey
Anna Casey
3,101 Points

What is being underlined? The text on your website or the code in you css file?

The code in the code challenge.

Got it thank you all so much!