我想知道如何获得 not-allowed
光标在我禁用的链接上。我试图将它添加到禁用事件中,但它在那里不起作用,然后我尝试使用相同的光标事件引入悬停效果。关于如何让它发挥作用的任何想法?我在这里包含了我的代码 CSS:
.disabled {
pointer-events: none;
cursor: not-allowed;
text-decoration: none;
color: rgba(255, 255, 255, 0.25);
}
.disabled:hover {
cursor: not-allowed;
}
和我的 HTML 在这里:<li><a href="index.html" class="disabled">Home</a></li>
最佳答案
您必须删除 pointer-events: none;
使这项工作。
body {
background: #555;
}
.disabled {
/* pointer-events: none; */ /* removed */
text-decoration: none;
color: rgba(255, 255, 255, 0.25);
}
.disabled:hover {
cursor: not-allowed;
}
<ul>
<li><a href="index.html" class="disabled">Home</a></li>
</ul>
关于html - 如何在禁用的链接上获取 “not-allowed” 光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64186238/