Skip to content
Related Articles

Related Articles

Improve Article

CSS | pointer-events Property

  • Last Updated : 05 Oct, 2021
Geek Week

This property is used to specify whether element show to pointer events and whether not show on the pointer.
 

Syntax:  

pointer-events: auto|none;

Default Value: auto

Property values:  

auto: This property is used to specify that an element must react to pointer events.
Syntax: 



pointer-events:auto;

Example: 

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</p>
 
</A>
    </body>
</html>                   

Output: 

none: This property is used to specify that an element does not react to pointer-events.
Syntax:  

pointer-events:none;

Example: 

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</p>
 
</a>
    </body>
</html>

Output: 

Supported Browsers: The browsers supported by pointer-events Property are listed below: 

  • Google Chrome 2.0
  • Internet Explorer 11.0
  • Firefox 3.6
  • Opera 9.0
  • Safari 4.0

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :