How can I use cursor: not-allowed on button or a? I tried the following:
.not-allowed {
pointer-events: auto! important;
cursor: not-allowed! important;
}
My button looks like this:
<a class="btn btn-primary btn-lg disabled not-allowed" href="https://www.example.com" role="button">Test</a>
Without the pointer-events is activated, the cursor can not be changed. But if pointer-events: auto, the button or a is clickable. If the pointer-events: none the cursor doesn't change.
Please help me, I despair!
To change how the mouse pointer looks In the search box, type mouse, and then click Mouse. Click the Pointers tab, and then do one of the following: To give all of your pointers a new look, click the Scheme drop-down list, and then click a new mouse pointer scheme.
Check that the battery of the mouse is charged. Make sure that the receiver (dongle) is firmly plugged in to the computer. If your mouse and receiver can operate on different radio channels, make sure that they are both set to the same channel.
you can't do this because pointer-events: none; disable all mouse functions, but you can do a trick and wrap your button with a div then use cursor: not-allowed; on this. Work great.
This is actually a bug in Bootstrap
The proposed solutions :
button:disabled {
cursor: not-allowed;
pointer-events: all !important;
}
or if you have this kind of structure :
<li class="disabled">
<a href="#">My Link</a>
</li>
then
li.disabled {
cursor: not-allowed;
}
li.disabled a {
pointer-events: none;
}
Use this:
.not-allowed {
cursor: not-allowed !important;
}
You can wrap your button in span like below
<span>
<button> click me </button>
</span>
Now in css don't allow pointer events on button and make cursor disabled for wrapper.
button {
pointer-events: none;
opacity: 0.7
}
span {
cursor: not-allowed;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With