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 CSS: Cascading Style Sheets What is CSS?

Cynthia Eng-Dinsel
Cynthia Eng-Dinsel
2,160 Points

Changing background and text color for nav

I tried to follow the video and change the links in the nav to orange and white, but it ignored the background color.

nav a { color: white; background-color: orange; }

Not sure what is going on. If I remove the a, it looks fine. Thanks.

3 Answers

Itsa Snake
Itsa Snake
3,852 Points

Maybe it wants you to use the shorthand for background as below. Can you paste the full question?

nav a { color: white; background: orange; }

Hi Cynthia,

I believe the video is using an internal style sheet so you will need to use style tags.

Jeff

<style>
  nav a {
    color: white;
    background-color: orange;
  }
</style>
Cynthia Eng-Dinsel
Cynthia Eng-Dinsel
2,160 Points

Thanks for responding. What might have happened, is that I had an <li></li> in the wrong area. I couldn't get the background to go green in the next video, so I downloaded the project and opened it up in sublime text. My main.css file was fine. My index.html was borked, and I would never have known, because it was behaving fine up until that point.

Sheesh. :/ Learning the hard way.