Open In App

What is the Cursor Property in CSS?

Last Updated : 19 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads