Friday , December 20 2024

How to disable click on links using CSS?

Easy question, easy solution. We can disable click on all links, or we can use id or class for the particular links that should be unlickable and use:
pointer-events: none;

I use it for the case when I need to disable clicks on the images to avoid popup windows on the mobile devices. So for my case, I used the following code:

@media screen and (max-width: 640px) {
span.itemImage a.modal {pointer-events: none;}
}

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

Color change for placeholder in input not working

By default, gray font is displayed, which does not blend well with a dark background. …

Leave a Reply

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