2017-04-18 71 views
0

我不想禁用我的主页中的属性选择器和pointer-events: disable;链接,但我想保持:悬停效果。禁用指针事件的链接,但保持活动:悬停事件

这是CSS:

Section#thumbnails .thumb a[title="Yorokobu"]{ 
    pointer-events: none !important; 
    display: block !important; 
    cursor: default; 
    } 

而这个网站:www.rafagarces.com/work

谢谢!

回答

1

这里你的答案:

section#thumbnails .thumb a[title="Yorokobu"]:hover { 
    pointer-events: visible !important; 
    cursor: auto; 
} 
+0

这不工作:/ –

1

您可以在:hover状态添加到父元素。

section#thumbnails .thumb a[title="Yorokobu"] { 
 
    pointer-events: none !important; 
 
    display: block !important; 
 
    cursor: default; 
 
} 
 

 
section#thumbnails .thumb:hover a[title="Yorokobu"] { 
 
    color: red; 
 
}
<section id="thumbnails"> 
 
    <span class="thumb"> 
 
    <a title="Yorokobu"> 
 
     Test 
 
    </a> 
 
    </span> 
 
</section>