What is the Cursor Property in CSS?
Last Updated :
19 Feb, 2024
The cursor
property in CSS is used to specify the type of cursor to be displayed when the mouse pointer is over an element. It allows you to enhance the user experience by indicating the expected interaction or action when interacting with different elements on a webpage.
Note: The cursor
property can take various values, representing different cursor types.
Syntax:
/* Changing the cursor to a pointer when over a link */
a {
cursor: pointer;
}
Features:
- Common Cursor Values:
auto
: The default cursor for the browser.
pointer
: Indicates a link or interactive element.
crosshair
: Displays a crosshair for precise selection.
default
: The default cursor (usually an arrow).
text
: Indicates text selection.
- You can use custom images for cursors, specifying a URL for the cursor file.
Share your thoughts in the comments
Please Login to comment...