How to disable a link using only CSS?

前端 未结 22 3216
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 02:58

Is there any way to disable a link using CSS?

I have a class called current-page and want links with this class to be disabled so that no action occurs

22条回答
  •  一个人的身影
    2020-11-22 03:35

    It's possible to do it in CSS

    .disabled{
      cursor:default;
      pointer-events:none;
      text-decoration:none;
      color:black;
    }
    Google

    See at:

    Please note that the text-decoration: none; and color: black; is not needed but it makes the link look more like plain text.

提交回复
热议问题