禁用链接 <a>

pointer-events

Syntax

 /* Keyword values */
pointer-events: auto;
pointer-events: none;
pointer-events: visiblePainted;
pointer-events: visibleFill;
pointer-events: visibleStroke;
pointer-events: visible;
pointer-events: painted;
pointer-events: fill;
pointer-events: stroke;
pointer-events: all; /* Global values */
pointer-events: inherit;
pointer-events: initial;
pointer-events: unset;

Example

1 <a href="link.html" class="not-active">Link</a>
2
3 .not-active {
4 pointer-events: none;
5 cursor: default;
6   opacity: 0.6;
7 }

jQuery Example

1 // disable button
2 $("#myLink").css({ 'pointer-events': 'none' });
3 // enable it again
4 $("#myLink").css({ 'pointer-events': '' });

Bootstrap Disabled Link

1  <a href="#" class="btn btn-primary btn-lg disabled" role="button">Primary link</a>
2 <a href="#" class="btn btn-default btn-lg disabled" role="button">Link</a>

相关:

Disabled Buttons

 <style>
.disabled {
opacity: 0.6;
cursor: not-allowed;
}
</style>