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
Carly Rhodes
2,008 PointsSelected Navigation Color
Hello! Everything is working well with my first website, except for one minor problem. The selected navigation is not changing color when selected (it is remaining white). Here is the css I have written. Can anyone tell what may be wrong?
/* nav link */ nav a, nav a:visited { color: #fff; }
/* selected nav link */ nav a.selected, nav a:hover { color: #185163; }
2 Answers
Jack Smith
6,902 PointsIf nav is a class try putting a period before it in your css
Daniel Gauthier
15,000 PointsHey Carly,
The two answers in this thread from Jack and Jennifer will likely help you get the code working.
I noticed you wrote out your code, so I figured you may be interested in learning how to post code in the forums for future reference.
Also, it's generally better to post all of your existing code when looking for help with bugs since it allows us to see everything you've written. There will be times where the issue is with a piece of code you're not seeing.
How to Post Code on the Forums
There are two ways to share your code on the forums here, excluding using external tools from outside of Treehouse.
The first method is to use a series of three ` (backticks, located at the top left of the keyboard) without any spaces on one line, paste all of your code starting on the second line, then closing the code block with a second series of three backticks. Take a peek at the link for the "Markdown Cheatsheet" located above the "Post Answer" button anytime you're about to post a comment or answer.
The second method is a little more convoluted, but it lets us look at your entire project and make our own copy to try fixing issues. I'll order the steps since it can be a little confusing the first time around:
Open the workspace you're having trouble with.
On the menu bar located to the left of the "Preview Workspace" button is the "Snapshot Workspace" (camera icon), click that.
A popout will appear with another button that says "Take Snapshot", click that.
It should create a new snapshot, which will appear beneath the "Take Snapshot" button in the popout. Click the snapshot you want to share.
The snapshot should open a new browser tab. Highlight the url in the snapshot's browser tab (it should look like this: https://w.trhou.se/ducj79b1i0 ).
Create your forum post and paste the snapshot's url into the post. Other Treehouse users will be able to open the snapshot, then 'fork' a new copy to check out.
Keep in mind that you can only ever have five snapshots, but you can delete them by hovering over the snapshot located below the "Take Snapshot" button in the popout and click the trash bin icon.
Good luck!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherFirst, make sure that your stylesheet is the last in order of linked stylesheets to that page. Given the nature of CSS you might be overwriting your own personal CSS with another CSS from bootstrap or some other css file.