
The cursor property changes the pointer shown above an element. It communicates what the visitor can do, but also provide visible or semantic feedback for touch and keyboard use.
1. Common cursor values
Use auto for the browser’s contextual default. pointer often indicates a link, text indicates text selection, and help can signal additional information. progress indicates that work is ongoing while interaction may still be possible.
2. Dragging, resizing, and unavailable actions
Use grab and grabbing for drag states, move when an object can be moved, and resize values such as ew-resize, ns-resize, or nwse-resize. not-allowed provides visual feedback but does not disable a control.
3. Custom cursor images
Add a supported image and a keyword fallback. Optional coordinates specify the hotspot. Keep the image small and test the fallback.
.drawing-surface { cursor: url("brush.png") 2 10, crosshair; }4. Practice
Give one enabled button an appropriate cursor, a disabled button not-allowed, and a draggable handle grab. Test with a mouse and check that all controls still convey their state without a pointer.
| Purpose | Examples |
|---|---|
| General | auto, default, none |
| Links or assistance | pointer, help, context-menu |
| Text or precision | text, vertical-text, crosshair |
| Status | wait, progress, not-allowed, no-drop |
| Drag and resize | grab, grabbing, move, col-resize, row-resize, ew-resize, ns-resize |