CSS cursor

« CSS « CSS Reference

Summary

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

Syntax

CSS 2.1

cursor:
[ [ <uri>
 ,]* 
  [ auto | crosshair | default | help | move | pointer  | progress | text | wait | e-resize | 
    ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize ] ]
] | inherit
CSS 3

cursor:
[ [ <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 ]
] | inherit

Values

<uri>
Optional.
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. See Using URL values for the cursor property for more details.
<x> <y>
Optional x- and y-coordinates (not supported by Internet Explorer). Two unit-less numbers.

Supported CSS standard values

Category CSS value
move mouse
over for testing
  Description
General auto   The browser determines the cursor to display based on the current context.
E.g. equivalent to text when hovering text.
default default.gif Default cursor, typically an arrow.
none   No cursor is rendered New in Firefox 3
Links & status context-menu context-menu.png A context menu is available under the cursor.
In Gecko/Firefox not implemented on Windows, bug 258960 WONTFIX.
help help.gif Indicating help is available.
pointer pointer.gif E.g. used when hovering over links, typically a hand.
progress progress.gif The program is busy in the background but the user can still interact with the interface (unlike for wait).
wait wait.gif The program is busy (sometimes an hourglass or a watch).
Selection cell cell.gif Indicating that cells can be selected.
crosshair crosshair.gif Cross cursor, often used to indicate selection in a bitmap.
text text.gif Indicating text can be selected, typically an I-beam.
vertical-text vertical-text.gif Indicating that vertical text can be selected, typically a sideways I-beam.
Drag and drop alias alias.gif Indicating an alias or shortcut is to be created.
copy copy.gif Indicating that something can be copied.
move move.gif The hovered object may be moved.
no-drop no-drop.gifCursor showing that a drop is not allowed at the current location.
bug 275173 on Windows, "no-drop is the same as not-allowed".
not-allowed not-allowed.gif Cursor showing that something cannot be done.
Resize & scrolling all-scroll all-scroll.gif Cursor showing that something can be scrolled in any direction (panned).
bug 275174 on Windows, "all-scroll is the same as move".
col-resize col-resize.gif The item/column can be resized horizontally. Often rendered as arrows pointing left and right with a vertical bar separating.
row-resize row-resize.gif The item/row can be resized vertically. Often rendered as arrows pointing up and down with a horizontal bar separating them.
n-resize n-resize.gif Some 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 e-resize.gif
s-resize s-resize.gif
w-resize w-resize.gif
ne-resize ne-resize.gif
nw-resize nw-resize.gif
se-resize se-resize.gif
sw-resize sw-resize.gif
ew-resize   Indicates a bidirectional resize cursor.
ns-resize  
nesw-resize  
nwse-resize  

Mozilla extensions

CSS value Description dropped deprecated since
-moz-cell Obsolete, use cell. Gecko 1.9.2 (Firefox 3.6) Gecko 1.8 (Firefox 1.5)
-moz-alias Obsolete, use alias. Gecko 2 (Firefox 4)
-moz-context-menu Obsolete, use context-menu.
-moz-copy Obsolete, use copy.
-moz-spinning Obsolete, use progress. Gecko 1.7.1 (Firefox 1.0)
-moz-grab grab.gif  An element can be grabbed.

This cursors are not recommended for use on public web pages.

Use of custom image cursors may provide better cross browser compatibility.

-moz-grabbing grabbing.gif  An element is currently being grabbed.
-moz-zoom-in zoom-in.gif  An element is actually being resized, enlarged or is actually being magnified. bug 204841
-moz-zoom-out zoom-out.gif  An element is actually being resized, reduced or is actually being zoomed out. bug 204841

Notes

Gecko 2.0 note
(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Support for loading a cursor from a URI was added for Mac OS X in Gecko 2.0; prior to that it was not supported on OS X.

Examples

.foo { cursor: crosshair; }

.bar { cursor: move;  cursor: cell; }  /* use move if cell isn't supported */ 

.baz { url(hyper.cur), auto }  /* standard cursor value as fallback must be provided */

Browser compatibility

  • Desktop
  • Mobile

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
auto | crosshair | default | move | text | wait | help | n-resize | e-resize | s-resize |w-resize | ne-resize | nw-resize | se-resize | sw-resize  1.0  1.0 (1.0)  4.0  7.0 1.2 (125)
 hand Non-standard (use pointer)  --
 --
 4.0  7.0 -- 
 pointer  1.0  1.0 (1.0)  6.0  7.0  1.2 (125)
 progress  1.0  1.0 (1.7.1)  6.0  7.2  3.0 (522)
url()
See Using URL values
 1.0  1.5 (1.8)  6.0  --
 3.0 (522-523)
not-allowed | no-drop | vertical-text | all-scroll | col-resize | row-resize  1.0  1.5 (1.8) --
 --
 3.0 (522)
none  5.0  3.0 (1.9) --
 --
 5.0 (533)
inherit 1.0 1.0 8.0 9.0 1.2
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? ? ? ? ?

See also

Tags (4)

Edit tags

Attachments (30)

FileSizeDateAttached by 
alias.gif
No description
176 bytes20:30, 26 Apr 2009Jürgen JekaActions
 all-scroll.gif
No description
98 bytes16:00, 21 Apr 2009Jürgen JekaActions
 cell.gif
No description
98 bytes16:00, 21 Apr 2009Jürgen JekaActions
col-resize.gif
No description
106 bytes23:04, 27 Apr 2009Jürgen JekaActions
context-menu.png
No description
233 bytes19:59, 25 Apr 2009Jürgen JekaActions
copy.gif
No description
173 bytes20:03, 25 Apr 2009Jürgen JekaActions
 crosshair.gif
No description
86 bytes16:01, 21 Apr 2009Jürgen JekaActions
 default.gif
No description
98 bytes16:01, 21 Apr 2009Jürgen JekaActions
 e-resize.gif
No description
88 bytes16:01, 21 Apr 2009Jürgen JekaActions
 grab.gif
No description
103 bytes16:01, 21 Apr 2009Jürgen JekaActions
 grabbing.gif
No description
91 bytes16:02, 21 Apr 2009Jürgen JekaActions
 help.gif
No description
119 bytes16:02, 21 Apr 2009Jürgen JekaActions
move.gif
No description
103 bytes20:01, 25 Apr 2009Jürgen JekaActions
 n-resize.gif
No description
95 bytes16:03, 21 Apr 2009Jürgen JekaActions
 ne-resize.gif
No description
99 bytes16:03, 21 Apr 2009Jürgen JekaActions
no-drop.gif
No description
141 bytes20:05, 25 Apr 2009Jürgen JekaActions
not-allowed.gif
No description
185 bytes20:17, 25 Apr 2009Jürgen JekaActions
 nw-resize.gif
No description
98 bytes16:03, 21 Apr 2009Jürgen JekaActions
 pointer.gif
No description
109 bytes16:03, 21 Apr 2009Jürgen JekaActions
progress.gif
No description
136 bytes20:30, 26 Apr 2009Jürgen JekaActions
row-resize.gif
No description
88 bytes23:04, 27 Apr 2009Jürgen JekaActions
 s-resize.gif
No description
91 bytes16:03, 21 Apr 2009Jürgen JekaActions
 se-resize.gif
No description
97 bytes16:03, 21 Apr 2009Jürgen JekaActions
 sw-resize.gif
No description
98 bytes16:04, 21 Apr 2009Jürgen JekaActions
 text.gif
No description
86 bytes16:04, 21 Apr 2009Jürgen JekaActions
 vertical-text.gif
No description
84 bytes16:04, 21 Apr 2009Jürgen JekaActions
 w-resize.gif
No description
89 bytes16:04, 21 Apr 2009Jürgen JekaActions
 wait.gif
No description
114 bytes16:04, 21 Apr 2009Jürgen JekaActions
zoom-in.gif
No description
98 bytes21:16, 26 Apr 2009Jürgen JekaActions
zoom-out.gif
No description
96 bytes21:16, 26 Apr 2009Jürgen JekaActions

Attach file