Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to implement unclickable style in css

Shulou Source: shulou.com Published: 2022-05-31 13:18:36 11月13日 Update

This article mainly introduces css how to achieve unclickable style related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this css how to achieve unclickable style article will have a harvest, let's take a look at it.

1. Add pointer-events:none; style directly to the element to prohibit triggering events and make it unclickable.

Pointer-events:none

2, first add the "cursor:not-allowed;" style to the element, and then use the js code to prevent the click event from being triggered to achieve unclickable.

Cursor:not-allowed;pointer-events:none

The style when the mouse is not clickable

Cursor:not-allowed

Note that although the style shows that it is not clickable, clicking will still trigger the corresponding event.

This is the end of the article on "how to achieve unclickable styles in css". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to achieve unclickable style in css". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Style event knowledge element content article code value easy to operate article easy to understand more watch industry information information channel channel mouse learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Docker Shulou Tech Info Xiaomi