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

Andrew Hunt
Andrew Hunt
7,665 Points

nav a - why won't this work?

I'm working through some of the basic challenge tasks for CSS and am coming unstuck with colouring nav anchors white. I've tried:

nav a { color: #fff }

nav a { color: #ffffff; }

and

nav a { color: #FFF }

but keep getting error messages, any ideas where I'm going 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 {
  background: #000000;
}

nav a {
  color: #FFF;
}
Andrew Hunt
Andrew Hunt
7,665 Points

OK, so in the end I had to copy and paste from a forum answer and the following worked:

p { color: #000000; }

nav a { color: #ffffff; }

It seems to be the 'background' on P that was being pushed back on, changing it to 'color' worked fine.

Muhammad Ehsan Hanif
Muhammad Ehsan Hanif
8,236 Points

Hi nav a { color: #fff; } is the correct CSS for coloring nav anchors. At which task you are stuck in the challenge?

1 Answer

Andrew Hunt
Andrew Hunt
7,665 Points

Thanks Muhammad, I think what confused me was that I got the error message on the next task (ie, after adding the nav a syntax) so thought the error must have been in the nav line, not the p one.