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 trialHenrik Christensen
Python Web Development Techdegree Student 38,322 PointsActive class when going to previous page?
Hi,
I just uploaded my website yesterday and have fixed some minor bugs today. Now I just got aware that there is a bug in the nav items on mobile devices and iPads.
The problem is when you go to either the portfolio or about page the active class is appended on the correct nav item BUT if you then click the "go back to previous page" button then it looks like both "Home" and "Portfolio" or "About" got the active class..
Any ideas how to fix this?
1 Answer
Jacob Mishkin
23,118 PointsI would suggest you use the focus pseudo class not active. Since you are using active It looks like its firing when you are active on a button, try using focus that way it should only run when you focus on that element.
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsHenrik Christensen
Python Web Development Techdegree Student 38,322 PointsHi Jacob,
Thank you very much for your suggestion but I'm not sure how you want me to use it. Are you thinking something like this?
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 PointsExactly. I don't everything that is going in the CSS but it looks like the active state is being triggered when an active state is being pressed. the Focus and hover states should only react to those states of hover and then focus then you click on the link.