Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Customizing Colors and Fonts Use Classes in CSS

Charles Ng
Charles Ng
4,444 Points

I thought only the "Portfolio" would turn dark green when hover. Why is it turned dark green already?

nav a.selected , nav a:hover { color: #32673f; } It is working as per your video showing. I just want to understand more. I thought only the "Portfolio" would turn dark green when hover. Why is it turned green permanently? "About" and "Contact" would turn green when the mouse hover over the text, as per your video.

I tried: nav a, nav a:hover { color: #32673f; }

Deleted the class "selected". "Portfolio" became white and turned green when hovered over. "About" and "Contact" turned green permanently.

Any explanation would be appreciated, thanks.

1 Answer

The class "selected" sets the text of that class to dark green, so it will allow the user to easily know what page they are on. It is meant to make that dark green. That is why when you deleted it, it no longer was this way.

As for the reason on the other two turning dark green permanently after you removed that class, I can't say without seeing your code.