FAQ: Learn Links and Buttons - Link States

This community-built FAQ covers the “Link States” exercise from the lesson “Learn Links and Buttons”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Navigation Design

FAQs on the exercise Link States

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

I don’t understand why do we need both a.question-link:active and a:active css rules here? To me they are duplicated since a:active should include a.question-link. The explanation within the exercise is not helpful. Any suggestions?

5 Likes

I’m quite confused by the active state in this lesson, it doesn’t do anything. Even if I replace my code with the solution, nothing happens. Is that the point? Did I miss something? I have also tried switching the colors, font size, all sorts of things for the active state to try to make it obvious so I don’t miss something happening, but nothing happens.

Sometimes with these lessons it’s hard to tell if there’s a bug or I’m just being taught about something not working and I have misunderstood.

3 Likes

I got it to work by using 2 separate rules…

.question-link:active {

color: red;

font-size: 200%;

}

a:active{

color: red;

font-size: 200%;

}

but the solution code is…

a:active .question-link:active {

color: #dbe9ee;

}

and it does nothing.

(note I added color: red; font-size: 200%; just so I could see something change)

2 Likes

I’m also confused. If the “question-link” rules make the “a” rules disfunction, why does the “cursor: pointer;” still work for question-links??

1 Like

Hi mimida,
I believe it’s due to the fact that the ‘cursor: pointer;’ is applied to all ‘a’ elements provided in the HTML, whereas the pseudo-classes only apply to certain behavioral rules. Clicking elements can change their appearance but the pointer overrides these more specific rules. Hope that helps!

I was also confused by the :active pseudo class. The CSS Trick has some good examples that helped me understand the use case better: :active | CSS-Tricks

3 Likes

Codecademy: Please! This exercise needs to be reworked! While it does make me understand the tools, options, and power of the elements introduced, the exercise itself lacks compelling illustrations. It takes quite a bit of second-guessing to truly understand this lesson. It would be far more helpful if the variables used in the exercise did more to illustrate actual changes. As it stands the exercise is very lackluster.

10 Likes

I keep running into things like this and it is SUPER frustrating!!

1 Like

I don’t understand what a:link does. It’s an unvisited link, so wouldn’t just using the a selector accomplish the same?

I’m also unclear on what a:active does. It’s a link that is clicked but not visited? When does that happen?

I don’t feel like this lesson explains these very well.

1 Like

I’m not sure what’s going on, but NONE of the links are responding on the preview and when I click on the link it takes me to the linked page. The back arrow doesn’t work, so I have to refresh. This means nothing changes on the links. Weird.

1 Like

I cannot see the difference between Task 1 and Task 2 because the link doesn’t blend with the background for me. What am I missing?

Yes the back arrow doesn’t work for me either, as I was expecting to press that and it to take me back to the webpage to show the relevant link’s changed colour. I was able to complete the 4 exercises but I’m not fully sure I understand the cascading rules.

1 Like

Glad I came to the forums, I thought it was a bug and was about to move on… I changed the colors like you stated for the :active and :visited on the .question link class, and understood the purpose of this exercise now :sweat_smile:

2 Likes

If you click a link and hold the click down, you will see the active CSS change. The problem is that the link goes to the linked address too quickly to see the active change if you click and let go.

4 Likes

I don’t get what’s the purpose of this lesson, or I’m missing something, because, whatever I do, nothings change. The lesson isn’t clear, it doesn’t say what active does, visited doesn’t change anything even if we visited the link. Only :hover works. This lesson gotta be changed, it seems that everyone gets confused…

Is this the first time in the web dev path that “cascading” is mentioned? I believe it is, which would be rather strange that it is mentioned on the fly via a link to an external website. Did I miss it maybe?

i was tryna understand the concept manage to somehow understand it

I think you can see this effect when you click and hold on a link. You can see it changes color while the click is held down.

Exercise 4- I don’t understand how .question-link:active is not redundant when a:active is already styled. Why don’t the question links at the top of the page inherit from a:active?

The only thing i can think of is a possibility of if you style 1 of the 4 Link States for a class, you HAVE TO style the rest as well? This is not explained at all in this lesson.

EDIT: I edited out .question-link:active and set a:active to black which I discovered just a:active did in-fact also change the .question-link class to black when a click is held on it. So .question-link:active does appear to be redundant.

I believe this lesson is just incorrect and whoever wrote it appears to, ironically enough, not fully understand inheritance.

1 Like