I show an image element when the user hovers over a link - this works.
Now I would like to make this image always visible to the user when he returns to the site ... My attempt below was (I think) blocked due to restrictions on the selector: visited.
Is there a way around these limitations to make this method work? Is there any other selector that I can use for the same effect?
a {
text-decoration: underline;
color: black;
}
#image {
position: absolute;
visibility: hidden;
top: 30%;
left: 60%;
}
a:visited {
color: red;
}
a:visited + #image {
visibility: visible;
}
a:hover{
color: white;
transition: color .3s ease;
}
a:hover + #image{
visibility: visible;
}
Run codeHide result
source
share