CSS pointer-events Property

Thuộc tính này chỉ định liệu một phần tử có hiển thị các sự kiện con trỏ hay không. Nó cũng chỉ định liệu có hiển thị trên con trỏ hay không.

Syntax:  

pointer-events: auto|none;

Default Value: auto

Property values:  

  • auto: Thuộc tính này chỉ định rằng một phần tử phải phản ứng với các sự kiện con trỏ.
  • none: Thuộc tính này chỉ định rằng một phần tử không phản ứng với các sự kiện con trỏ.

Example: Trong ví dụ này, ta sử dụng thuộc tính pointer-events: auto;.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        CSS | pointer-events Property
    </title>
    <style>
        p.geeks {
            pointer-events: auto;
        }
        
        h1,
        h2 {
            color: green;
        }
        
        body {
            text-align: center;
        }
    </style>
</head>

<body>
    <CENTER>
        <h1>GeeksForGeeks</h1>
        <h2>pointer-events:auto;</h2>
        <p class="geeks">
            <a href="#">GeeksforGeeks </a>
        </p>
    </CENTER>
</body>

</html>


Output: 

css-pointer-events-property

Example: Trong ví dụ này, chúng ta đang sử dụng thuộc tính pointer-events: none;.

html
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS | pointer-events Property
    </title>
    <style>
        p.geeks {
            pointer-events: none;
        }

        h1,
        h2 {
            color: green;
        }

        body {
            text-align: center;
        }
    </style>
</head>

<body>
    <h1>GeeksForGeeks</h1>
    <h2>pointer-events:none;</h2>
    <p class="geeks">
        <a href="#">GeeksforGeeks</a>
    </p>
</body>
</html>

Output: 

css-pointer-events-property

Supported Browsers: Các trình duyệt được hỗ trợ bởi pointer-events Property được liệt kê dưới đây: 

  • Google Chrome 1.0
  • Edge 12.0
  • Internet Explorer 11.0
  • Firefox 1.5
  • Opera 9.0
  • Safari 4.0

Last Updated : 21/07/2025