gpt4 book ai didi

html - 如何在禁用的链接上获取 “not-allowed” 光标

转载 作者:行者123 更新时间:2023-12-03 23:26:32 24 4
gpt4 key购买 nike

我想知道如何获得 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com