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.
Fundamentals
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.
Foundation
📝 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.
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.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
All elements
Inherited
Yes
Animatable
No
Common clickable value
pointer
Reference
💎 Property Values
The cursor property accepts keyword values, custom image URLs, and fallback keywords.
Value
Description
auto
Default cursor — the browser chooses based on context.
default
Arrow cursor.
pointer
Hand cursor, typically used for links and buttons.
text
Text cursor (I-beam), used over selectable text.
move
Move cursor, used for draggable items.
wait
Wait cursor — watch or hourglass while loading.
help
Help cursor, usually a question mark.
crosshair
Crosshair cursor for precision selection.
not-allowed
No-entry cursor for disabled or blocked actions.
grab / grabbing
Open and closed hand for drag interactions.
url(path), fallback
Custom cursor image with a required keyword fallback.
Context
When to Use Each Cursor
Scenario
Recommended cursor
Buttons, links, clickable cards
pointer
Disabled buttons or blocked actions
not-allowed
Draggable panels or cards
grab / grabbing
Loading or processing state
wait or progress
Tooltip or help icon
help
Editable text areas
text (often automatic with auto)
Preview
👀 Live Preview
Hover each box to see a different cursor style in action:
pointer
text
grab
not-allowed
help
wait
Hands-On
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>
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.
Compatibility
🖥 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 ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions
Full support
OperaAll modern versions
Full support
cursor property99% supported
Bottom line: Standard cursor keywords are safe everywhere. Custom url() cursors may need testing; always include a keyword fallback.
Wrap Up
🎉 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.
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about cursor
Use these points when styling interactive interfaces.
5
Core concepts
🖱01
Visual hint
Pointer feedback.
Purpose
⚙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.