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 trialnicolaspeterson
8,569 Pointsmain a:hover not working please help!
I input the color value for main a:hover exactly as shown in the video, but it won't work when I launch the page. Any idea why? I opened the inspector on the webpage and the color property and its value were crossed out. I thought perhaps the browser wouldn't render the tomato color so I tried changing it to a simple red, but it still wouldn't work. I have no idea why this is...
1 Answer
Avery Blake
7,419 PointsI had the same issue, but then i solved it by putting the 'main a: visited' rule above the 'main a: hover' rule in my stylesheet.
like this: main a:visited { color: red; }
main a:hover{ color: aqua; }
Here is a quote i found from the MDN docs. "To style links appropriately, put the :visited rule after the :link rule but before the :hover and :active rules, as defined by the LVHA-order: :link — :visited — :hover — :active."
MDN :visited rule doc - https://developer.mozilla.org/en-US/docs/Web/CSS/:visited
Muaaz Matwadia
Full Stack JavaScript Techdegree Graduate 19,327 PointsMuaaz Matwadia
Full Stack JavaScript Techdegree Graduate 19,327 PointsHi nicolaspeterson ,Can you show your code?Thanks