CSS cursor Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The cursor property sets the mouse cursor shown when the pointer is over an element. Use it to signal what the user can do: click, select text, wait, or that an action is blocked.

You can use a keyword such as pointer, or load a custom image with url() and a mandatory keyword fallback. The property is inherited, so a parent cursor applies to children unless they override it.

Baseline · Widely available.

Not deprecated. Core keywords are widely supported. Some keywords and custom image formats still have uneven support across browsers and platforms (for example iPadOS mainly changes appearance for text).

CSS Syntax

syntax.css
cursor: [url(...) <x> <y>? ,]* <keyword> | initial | inherit;

Zero or more image URLs (with optional hotspot), then one required keyword. Example: cursor: url("hand.cur"), pointer;.

Property Values

ValueDescriptionTry it
autoDefault. Browser picks a cursor from contextTry it
defaultPlatform arrow cursorTry it
pointerHand icon. Use for links and clickable controlsTry it
textI-beam. Signals selectable or editable textTry it
not-allowedAction will not run. Common on disabled controlsTry it
wait / progressBusy state. wait blocks interaction; progress still allows itTry it
grab / grabbingItem can be dragged, or is being draggedTry it
help / crosshairHelp is available, or a precise crosshair for selectionTry it
url() + keywordCustom image, then a required keyword fallbackTry it
initial / inheritinitial resets to auto. inherit takes the parent valueTry it

Other keywords exist for resizing and zooming (ew-resize, zoom-in, and similar). Start with the values above for everyday UI.

How to Use cursor

Match the cursor to the action the user can perform on that element.

  1. Choose the interactive element (button, link, text field, drag handle).
  2. Pick a keyword that matches the action: pointer, text, grab, not-allowed, and so on.
  3. For a custom image, add url(...) values and end with a keyword fallback.
  4. Remember inheritance: set a parent cursor only when children should share it.
PieceRequired?Role
KeywordYesAlways required, including as the last fallback after images
Hoverable pointerYes (to see it)Touch-only devices may not show a mouse cursor
Custom url()OptionalMust end with a keyword. Keep images small (about 32×32)
InheritedBy designChildren inherit unless they set their own cursor

Live Preview

Change cursor, then move the mouse over the box to see the pointer update.

Hover the box after applying a value. A mouse or trackpad is required to see the change.

Hover target

cursor: pointer

CSS Examples

Each snippet focuses on cursor. Hover the output to see the pointer. Use Try It Yourself for a live editor.

Example 1 — Clickable Pointer

Show a hand cursor on a button-like element.

CSS
<style>
  button {
    cursor: pointer;
  }
</style>

<button type="button">Save</button>
Try It Yourself

How It Works

  1. Target the control. The rule applies to the button.
  2. Set pointer. The browser shows the hand icon over that element.
  3. Signal interactivity. Users expect a hand on clickable UI, even when the element is not an <a>.
  4. Hover to verify. Move the mouse over the output box to see the change.

Example 2 — Disabled Action

Show that an action cannot be performed.

CSS
<style>
  .disabled {
    cursor: not-allowed;
  }
</style>

<button type="button" class="disabled" disabled>Delete</button>
Try It Yourself

How It Works

  1. Mark the control as unavailable. The example uses a disabled button class.
  2. Set not-allowed. The cursor shows that the action will not run.
  3. Pair with real state. Cursor alone is feedback. Still disable the control in HTML or script.
  4. Do not rely on cursor alone for access. Keyboard and screen-reader users need the disabled state too.

Example 3 — Draggable Handle

Show that an item can be grabbed and moved.

CSS
<style>
  .handle {
    cursor: grab;
  }
  .handle:active {
    cursor: grabbing;
  }
</style>

<div class="handle">Drag handle</div>
Try It Yourself

How It Works

  1. Idle state. grab tells the user the item can be dragged.
  2. Active state. :active switches to grabbing while the button is held.
  3. Feedback only. Cursor does not implement drag logic. Pair it with pointer events or a drag library.
  4. Hover and press. Move over the box, then press to compare the two cursors in the editor.

Edge Cases & Pitfalls

If the cursor looks wrong or never changes, check these first.

url

Custom images need a keyword fallback

cursor: url("hand.cur") alone is invalid. End with a keyword: cursor: url("hand.cur"), pointer;. Prefer small PNG/CUR icons around 32×32.

inherit

Cursor is inherited

A pointer on a card can make nested text look clickable. Override children with cursor: auto or text when needed.

touch

No mouse means no visible cursor

Touch-first phones do not show a mouse cursor. Keep affordances clear with layout and focus styles, not cursor alone. pointer-events is a different property.

platform

Some keywords look the same on some OS

MDN notes cases such as no-drop matching not-allowed on Windows/macOS in Firefox. Test critical feedback on your target platforms.

a11y

Cursor is not a substitute for state

Do not use pointer on non-interactive text, or not-allowed without disabling the control. Keyboard users need real HTML state and focus styles.

Browser Support

cursor is a browser CSS property for pointer appearance. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

cursor

Keyword cursors work in all modern browsers and Internet Explorer. Some keywords and custom images have partial or platform-specific behavior.

97% Core keyword support
Google Chrome All modern versions
Full support
Mozilla Firefox All modern versions
Full support
Apple Safari All modern versions
Full support
Microsoft Edge All modern versions
Full support
Opera All modern versions
Full support
Samsung Internet Supported
Full support
Internet Explorer Core keywords
Partial
cursor Widely supported

Bottom line: Safe for everyday keywords such as pointer, text, and not-allowed. Verify custom images and less common keywords on target devices. It is not a runtime API.

Key Takeaways

  • Role: show what the mouse can do over an element.
  • Initial value: auto. The property is inherited.
  • Common picks: pointer, text, not-allowed, grab, wait.
  • Custom images: always end url() lists with a keyword fallback.

One line: set cursor to match the action — and never use it as the only sign that something is interactive.

Frequently Asked Questions

It sets the mouse cursor shown when the pointer is over an element. Use it to signal clickable, editable, busy, or disabled actions.
The initial value is auto. The browser chooses a cursor from context, such as text over selectable text or pointer over links.
default is the platform arrow. pointer is the hand icon used for links and clickable controls.
Yes. A cursor on a parent applies to children unless a child sets its own value.
Yes. Use one or more url() images, optional hotspot coordinates, and end with a mandatory keyword fallback, for example cursor: url('hand.cur'), pointer;
Keyword cursors are Baseline Widely available. Some keywords and custom images have uneven support. It is a browser CSS property, not a Node.js feature.

Next: direction

Set the inline base direction for text and layout.

direction tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful