Tutorialspoint.dev

CSS | pointer-events Property

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

Syntax:

pointer-events: auto|none;

Property:

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

    Syntax:

    pointer-events:auto;

    Example:



    <!DOCTYPE html>
    <html>
        <head>
            <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:

    <!DOCTYPE html>
    <html>
        <head>
            <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:



This article is attributed to GeeksforGeeks.org

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter