CSS Cursor Property

The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.

The curser setting should inform users of the mouse operations that can be performed at the current location, including: text selection, activating help or context menus, copying content, resizing tables, and so on. You can specify either the type of cursor using a keyword, or load a specific icon to use (with optional fallback images and mandatory keyword as a final fallback).

Definition and Usage

The cursor property specifies the mouse cursor to be displayed when pointing over an element.

Values

  • <url> (Optional): A url(…) or a comma separated list url(…), url(…), …, pointing to an image file. More than one url() may be provided as fallbacks, in case some cursor image types are not supported. A non-URL fallback (one or more of the keyword values) must be at the end of the fallback list.
  • <x> <y> (Optional): Optional x- and y-coordinates indicating the cursor hotspot; the precise position within the cursor that is being pointed to.
    The numbers are in units of image pixels. They are relative to the top left corner of the image, which corresponds to “0 0”, and are clamped within the boundaries of the cursor image. If these values are not specified, they may be read from the file itself, and will otherwise default to the top-left corner of the image.
  • keyword: A keyword value must be specified, indicating either the type of cursor to use, or the fallback cursor to use if all specified icons fail to load.
    The available keywords are listed in the table below. You can hover your mouse over the table rows to see the effect of the different cursor keyword values on your browser.

Demo time!

See the Pen CSS Cursor property demo by Carles Rider (@carlesrider) on CodePen.