Is it possible to make an HTML anchor tag not clickable/linkable using CSS?

前端 未结 9 2179
故里飘歌
故里飘歌 2020-12-12 11:33

For example if I have this:

page link

Is there anything I can use for the style attribute that

9条回答
  •  醉话见心
    2020-12-12 11:48

    CSS was designed to affect presentation, not behaviour.

    You could use some JavaScript.

    document.links[0].onclick = function(event) {
       event.preventDefault();
    };
    

提交回复
热议问题