如何使用 cursor: not-allowed on button 或 a ?我尝试了以下方法:
.not-allowed {
pointer-events: auto! important;
cursor: not-allowed! important;
}
我的按钮如下所示:
<a class="btn btn-primary btn-lg disabled not-allowed" href="https://www.example.com" role="button">Test</a>
如果没有激活指针事件,则无法更改光标。但是如果 pointer-events: auto , 按钮 或 a 是可点击的。如果 pointer-events: none 光标不会改变。
请帮助我,我绝望了!
原文由 PaT 发布,翻译遵循 CC BY-SA 4.0 许可协议
这实际上是 Bootstrap 中的一个 错误
建议的解决方案:
或者如果你有这种结构:
然后