cursor property CSS Reference



Definition and Usage

The cursor CSS property specifies the mouse cursor displayed when the mouse pointer is over an element.

  • Initial auto
  • Applies to all elements
  • Inherited yes
  • Media visual, interactive
  • Computed Value as specified, but with relative URI converted into absolute URI
  • Animatable no
  • Canonical order the unique non-ambiguous order defined by the formal grammar

Syntax

Formal syntax: [ [ <uri> [<x> <y>]?,]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ]

Values

<uri>
A url(…) or a comma separated list url(…), url(…), …, pointing to an image file. More than one <uri> may be provided as fallback, in case some cursor image types are not supported. A non-URL fallback (one ore more of the other values) must be at the end of the fallback list.
<x> <y>
Optional x- and y-coordinates. Two unit-less non-negative numbers less than 32.
Keyword values
Move mouse over value for testing:
CategoryCSS valueDescription
GeneralautoThe browser determines the cursor to display based on the current context.
E.g. equivalent to text when hovering text.
defaultDefault cursor, typically an arrow.
noneNo cursor is rendered.
Links & statuscontext-menuA context menu is available under the cursor.
Only IE 10 and up have implemented this on Windows: bug 258960.
helpIndicating help is available.
pointerE.g. used when hovering over links, typically a hand.
progressThe program is busy in the background but the user can still interact with the interface (unlike for wait).
waitThe program is busy (sometimes an hourglass or a watch).
SelectioncellIndicating that cells can be selected.
crosshairCross cursor, often used to indicate selection in a bitmap.
textIndicating text can be selected, typically an I-beam.
vertical-textIndicating that vertical text can be selected, typically a sideways I-beam.
Drag and dropaliasIndicating an alias or shortcut is to be created.
copyIndicating that something can be copied.
moveThe hovered object may be moved.
no-dropCursor showing that a drop is not allowed at the current location.
not-allowedCursor showing that something cannot be done.
Resize & scrollingall-scrollCursor showing that something can be scrolled in any direction (panned).
bug 275174 on Windows, "all-scroll is the same as move".
col-resizeThe item/column can be resized horizontally. Often rendered as arrows pointing left and right with a vertical bar separating.
row-resizeThe item/row can be resized vertically. Often rendered as arrows pointing up and down with a horizontal bar separating them.
n-resizeSome edge is to be moved. For example, the se-resize cursor is used when the movement starts from the south-east corner of the box.
e-resize
s-resize
w-resize
ne-resize
nw-resize
se-resize
sw-resize
ew-resizeIndicates a bidirectional resize cursor.
ns-resize
nesw-resize
nwse-resize
Zoomzoom-in

Indicates that something can be zoomed (magnified) in or out.

zoom-out
Grabgrab

Indicates that something can be grabbed (dragged to be moved).

grabbing

Examples

.foo { cursor: crosshair; }
/* use prefixed-value if "zoom-in" isn't supported */
.bar { cursor: -webkit-zoom-in;  cursor: zoom-in; }
/* standard cursor value as fallback for url() must be provided (doesn't work without) */
.baz { cursor: url(hyper.cur), auto }

Compatibility

FeatureChrome (WebKit)Firefox (Gecko)Internet ExplorerOperaSafari
auto, crosshair, default, move, text, wait, help,
n-resize, e-resize, s-resize, w-resize,
ne-resize, nw-resize, se-resize, sw-resize
1.01.0 (1.0)4.07.01.2
pointer, progress1.01.0 (1.0 | 1.7)6.07.x1.2 | 3.0
url()1.0 (523)1.5 (1.8);
OS X: 4.0 (2.0)
6.0NA3.0
Positioning syntax for url() values (Yes)(Yes)Not supportedNA(Yes)
not-allowed, no-drop, vertical-text, all-scroll,
col-resize, row-resize
1.0 (522)1.5 (1.8)6.010.63.0
alias, cell, copy,
ew-resize, ns-resize, nesw-resize, nwse-resize
1.0 (522)1.5 (1.8)10.010.63.0
context-menuOS X, Linux: 1.0 (522)OS X, Linux: 1.5 (1.8)10.010.63.0
none5.0 (533)3.0 (1.9)9.0NA5.0
inherit1.01.08.09.01.2
zoom-in, zoom-out1.0 (522) -webkit-1.0 (1.4) -moz-
24.0
NA11.63.0 -webkit-
grab, grabbing1.0; Windows: 22.0 -webkit-1.5 (1.8) -moz-
27.0
Not supportedNA4.0 -webkit-

Relative articles