I am showing an image element when the user hovers over a link-- this is working.
I would now like to make that image always visible to the user when they return to the site... My attempt below was (I think) foiled because of restrictions on the :visited selector.
Is there a way to get around these restrictions to make this method work? Is there another selector I can use to 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;
}
There are limits to what the
:visited
selector can style: https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selectorIt might seem that you've run up against one.