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 The Selectors Solution

Bernadette Isaacson
Bernadette Isaacson
13,736 Points

Create hover and visited styles for all links inside 'main': Doesn't the order matter?

The solution in the video shows the rule for hover followed by visited, but that doesn't seem to work. The order matters--it should be visited followed by hover.

https://css-tricks.com/snippets/css/link-pseudo-classes-in-order/

Dayana Guevara
Dayana Guevara
Courses Plus Student 2,008 Points

It does works! In the excercise both pseudoclasses are refered to DIFFERENT links, 'hover' for navigation links and 'visited' for the links within de "main" section. The order matter when both pseudoclasses are applied to the same selector.

2 Answers

Bernadette Isaacson
Bernadette Isaacson
13,736 Points

Yes, however the instructor doesn't adhere to that order in the video so the style sheet, as he has written it, is incorrect. I just wanted to point that out in case someone else gets confused and also bring it attention to staff that the video has an obvious error.