An active selector is used to style and select an active link.
It can be used to change the
The syntax is:
TAG:action TAG NAME:active{
//enter the properties you want to change
}
The actions can be any acceptable action (e.g., hover or visited). These actions can help with user accessibility. For example, if a link has been visited it will change color to distinguish itself from those links the user has not yet visited.
Here is an example of how this property can be used:
Now, when a user hovers over “Hello and welcome to educative”, it changes color to a yellow background.
In the case of multiple tags in a given file, we can use the class names to distinguish. In that case, we add TAG.Classname:active
to make that particular tag active. Here is an example:
In this case, only the “Hello” changes color when a user hovers over the link.
Free Resources