当用户将鼠标悬停在链接上时,我正在显示图像元素 - 这是有效的.
我现在想让用户在返回网站时始终可以看到该图片...由于对被访问选择器的限制,我的下面尝试(我认为)被挫败了.
有没有办法解决这些限制,使这种方法有效?我可以使用另一个选择器来达到同样的效果吗?
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 Code Online (Sandbox Code Playgroud)