CSS cursor Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
UI & Interaction

What You’ll Learn

The cursor property controls the mouse pointer over any element — a small CSS detail that makes interfaces feel clearer and more interactive.

01

Pointer types

Keyword values.

02

Clickable UI

pointer on buttons.

03

Default auto

Browser decides.

04

Disabled states

not-allowed cursor.

05

Drag & drop

grab / grabbing.

06

Custom images

url() fallback.

Introduction

The cursor property in CSS is used to specify the type of cursor to be displayed when pointing over an element. This property helps enhance the user experience by providing visual feedback about the interactive nature of various elements, such as links, buttons, and draggable items.

Definition and Usage

Apply cursor to any element where the pointer appearance should change on hover. Use it alongside semantic HTML and accessible focus styles — the cursor is a visual hint, not a substitute for proper markup.

💡
Beginner Tip

Use cursor: pointer on custom buttons and clickable cards. Native <a> links often show a pointer automatically, but styled <div> or <span> click targets need it explicitly.

📝 Syntax

The syntax for the cursor property is straightforward. You can apply it to any element that you want to change the cursor for.

syntax.css
element {
  cursor: value;
}

Here, value can be a predefined cursor keyword, a URL to an image file, or multiple values as a fallback list.

Basic Example

cursor-pointer.css
button {
  cursor: pointer;
}
cursor: auto; cursor: pointer; cursor: not-allowed; cursor: grab; cursor: url(hand.cur), pointer;

Default Value

The default value of the cursor property is auto, which means the browser will determine the cursor type based on the context (e.g., text cursor for text fields, pointer cursor for links).

Syntax Rules

  • Use keyword values for standard system cursors.
  • Custom cursors require a fallback keyword after the URL list.
  • The property is inherited — children use the parent cursor unless overridden.
  • Match cursor style to actual behavior (don’t use pointer on non-clickable elements).
  • Some keywords like grab and zoom-in may look different across operating systems.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toAll elements
InheritedYes
AnimatableNo
Common clickable valuepointer

💎 Property Values

The cursor property accepts keyword values, custom image URLs, and fallback keywords.

ValueDescription
autoDefault cursor — the browser chooses based on context.
defaultArrow cursor.
pointerHand cursor, typically used for links and buttons.
textText cursor (I-beam), used over selectable text.
moveMove cursor, used for draggable items.
waitWait cursor — watch or hourglass while loading.
helpHelp cursor, usually a question mark.
crosshairCrosshair cursor for precision selection.
not-allowedNo-entry cursor for disabled or blocked actions.
grab / grabbingOpen and closed hand for drag interactions.
url(path), fallbackCustom cursor image with a required keyword fallback.

When to Use Each Cursor

ScenarioRecommended cursor
Buttons, links, clickable cardspointer
Disabled buttons or blocked actionsnot-allowed
Draggable panels or cardsgrab / grabbing
Loading or processing statewait or progress
Tooltip or help iconhelp
Editable text areastext (often automatic with auto)

👀 Live Preview

Hover each box to see a different cursor style in action:

pointer
text
grab
not-allowed
help
wait

Examples Gallery

In this example, we’ll change the cursor to a pointer when hovering over a button — plus patterns for disabled states, drag interactions, and multiple cursor types.

🖱 Basic Cursor Styles

Start with the reference example — a pointer cursor on a clickable button.

Example 1 — Pointer on a Button

Change the cursor to a pointer when hovering over a button to signal clickability.

cursor-pointer.html
<style>
  button {
    cursor: pointer;
  }
</style>

<button>Hover over me!</button>
Try It Yourself

How It Works

cursor: pointer tells the browser to show a hand icon, indicating the button is interactive.

Example 2 — Not Allowed on Disabled Elements

Show users that an action is unavailable with cursor: not-allowed.

cursor-not-allowed.css
.btn-disabled {
  cursor: not-allowed;
}
Try It Yourself

How It Works

Pair not-allowed with the disabled attribute so both appearance and cursor communicate that the control cannot be used.

🛠 Drag & Feedback Cursors

Use specialized cursors for draggable content and multi-state UI feedback.

Example 3 — Grab Cursor for Draggable Items

Use grab on hover and grabbing while the user is actively dragging.

cursor-grab.css
.card {
  cursor: grab;
}

.card:active {
  cursor: grabbing;
}
Try It Yourself

How It Works

grab signals that the element can be picked up; :active switches to grabbing during the drag gesture.

Example 4 — Multiple Cursor Types

Compare text, help, wait, crosshair, and move cursors on different elements.

cursor-showcase.css
.cursor-text { cursor: text; }
.cursor-help { cursor: help; }
.cursor-wait { cursor: wait; }
.cursor-crosshair { cursor: crosshair; }
.cursor-move { cursor: move; }
Try It Yourself

How It Works

Each class applies a different keyword. Hover over each box in the live editor to see the system cursor change.

🧠 How cursor Works

1

User hovers an element

The browser checks which element is under the mouse pointer.

Interaction
2

CSS cursor is resolved

The nearest ancestor with a cursor value wins (inherited by default).

Cascade
3

System cursor updates

The OS renders the matching icon — pointer, text, grab, etc.

Display
=

Clear visual feedback

Users instantly understand what they can click, drag, or edit.

🖥 Browser Compatibility

The cursor property is supported in all modern browsers. Different cursor types may have varying levels of support, so it’s good practice to test your cursor styles across different browsers to ensure they display as expected.

Baseline · Universal support

Cursor everywhere

cursor is one of the oldest and most widely supported CSS properties. Standard keywords work in every modern browser.

99% Universal support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions
Full support
Opera All modern versions
Full support
cursor property 99% supported

Bottom line: Standard cursor keywords are safe everywhere. Custom url() cursors may need testing; always include a keyword fallback.

🎉 Conclusion

The cursor property in CSS is a versatile tool for improving the user interface of your website. By customizing the cursor for different elements, you can provide better visual feedback and enhance the overall user experience.

Experiment with different cursor values to see how they can add a polished and intuitive touch to your web projects.

💡 Best Practices

✅ Do

  • Use pointer on custom clickable elements (buttons, cards, tabs)
  • Use not-allowed on truly disabled or blocked interactions
  • Pair grab / grabbing with actual drag behavior
  • Always provide a keyword fallback after custom url() cursors
  • Test cursor appearance on Windows, macOS, and mobile if relevant

❌ Don’t

  • Use pointer on non-interactive elements — it misleads users
  • Rely on cursor alone for accessibility — use proper ARIA and focus styles
  • Override cursors on native form controls without good reason
  • Use oversized custom cursor images that obscure content
  • Assume every keyword looks identical across all operating systems

Key Takeaways

Knowledge Unlocked

Five things to remember about cursor

Use these points when styling interactive interfaces.

5
Core concepts
02

Default auto

Browser picks.

Default
👆 03

pointer

For clickables.

Common
📝 04

Inherited

Sets on parent.

Tip
🛸 05

Match behavior

Cursor = action.

Pattern

❓ Frequently Asked Questions

The cursor property sets the mouse pointer appearance when hovering over an element. It gives users visual feedback about whether something is clickable, draggable, editable, or disabled.
The initial value is auto, which lets the browser choose the appropriate cursor based on context — for example, a text cursor over editable text or a pointer over links.
default shows the standard arrow cursor. pointer shows a hand icon and is commonly used for buttons and clickable elements to signal interactivity.
Yes. Use url(path) with optional x y hotspot coordinates, followed by a fallback keyword: cursor: url('hand.cur'), pointer;
Yes, cursor is inherited. Set it on a parent container and child elements will use the same cursor unless they override it.

Practice in the Live Editor

Open the HTML editor, add cursor: pointer to a button, and explore other cursor keywords on hover targets.

HTML Editor →

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.

5 people found this page helpful