Method 1: Using a CSS class for the links
A CSS class is created that changes the cursor property. The cursor property is used to specify the mouse cursor to be displayed when the mouse is pointed over an element. Using the ‘pointer’ value in this property will change the cursor to a ‘pointer’ indicating a link.
This class can then be used on any link that does not have any href property to show the pointer.
Syntax
.pointer-link { cursor: pointer; }
<!DOCTYPE html> <html> <head> <title>How to set cursor style to pointer for links without href ?</title> <style> .pointer-link { cursor: pointer; } </style> </head> <body> <h1 style="color: green"> Bajarangi Soft </h1> <b>How to set cursor style to pointer for links without href ?</b> <p>The <a> link below has the cursor style set to pointer.</p> <a class="pointer-link">Example link</a> </body> </html> <!DOCTYPE html> <html> <head> <title>How to set cursor style to pointer for links without href ?</title> </head> <body> <h1 style="color: green"> Bajarang Soft </h1> <b>How to set cursor style to pointer for links without href ?</b> <p>The <a> link below has the cursor style set to pointer.</p> <a onmouseover="this.style.cursor='pointer'">Example link</a> </body> </html>
<a onmouseover="this.style.cursor='pointer'>Example link</a>
<!DOCTYPE html> <html> <head> <title>How to set cursor style to pointer for links without href ?</title> </head> <body> <h1 style="color: green"> Bajarangi soft </h1> <b>How to set cursor style to pointer for links without href ?</b> <p>The <a> link below has the cursor style set to pointer.</p> <a onmouseover="this.style.cursor='pointer'">Example link</a> </body> </html>