Is there an easy (non-hackish?) way to make a Bootstrap button lookalike that's not clickable (and I don't mean a disabled button). Basically a <div class="btn btn-default">Something</div>
that doesn't behave like a link.
Thanks in advance
Active/Disabled Buttons The class . active makes a button appear pressed, and the disabled attribute makes a button unclickable. Note that <a> elements do not support the disabled attribute and must therefore use the . disabled class to make it visually appear disabled.
To make a button non-clickable, you can enter: pointer-events: none; into the button module's "Button Settings > Advanced > Custom CSS > Main Element" box, like so: Note that this will also disable the hover effect on the button.
As @benrwb mentioned in the comments, the most elegant solution would be to set the elements style property "pointer-events" to "none".
E.g.
<button type="button" class="btn btn-primary">My Button</button>
becomes
<button type="button" class="btn btn-primary" style="pointer-events: none;">My Button</button>
This doesn't only work on Bootstrap buttons, but also every other HTML element that has some kind of hover actions.
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