How to disable a link in Bootstrap with CSS?

Spread the love

To disable a link in Bootstrap with CSS, we set the pointer-events property.

For instance, we write

<a href="#" class="disabled" tabindex="-1">Link to disable</a><br />

to add a link.

Then we write

a.disabled {
  color: gray;
  pointer-events: none;
}

to set pointer-events to none to disable clicks on the link with class disabled.

We set its color to gray to make the text look grayed out.

Leave a Reply

Your email address will not be published. Required fields are marked *