Is there a state for "currently clicked"? Lets say there are three links in the nav menu, how do you get it to keep a certain color when currently "on" the link? to show the user where he currently is. as :active only works as long as the link (in this case) is being clicked, but changes back on mouse button-release. –
Asked
Active
Viewed 92 times
-1
-
Use Aaron Fitch's "checkbox hack" that you can see in caramba's link, if you want to avoid using javascript. – Rickard Elimää Dec 08 '21 at 20:50
1 Answers
0
It doesn't work "that way". One common way of dealing with it would be to add a body class on the page you are on:
<body class="about-us">
...then you hook into that in your CSS:
.about-us .nav .about { color: red }

mayersdesign
- 5,062
- 4
- 35
- 47