QA
Beginner LevelCSS & Modern Layouts

What do cursor, pointer-events, and user-select control in CSS?

❓ Interview Prompt: Explain interactive cursor styling, disabling click events, and preventing text selection.

These properties control user interaction behavior:

•
`cursor`: Changes the mouse cursor icon. Common values: pointer (clickable), not-allowed (disabled), grab/grabbing (draggable), text (selectable text).
•
`pointer-events: none`: Makes an element completely ignore mouse/touch interactions. Clicks pass through to elements underneath.
•
`user-select: none`: Prevents text selection (useful for buttons, drag handles). Use sparingly — never disable on actual readable content.

Code Implementation Example

css
.btn { cursor: pointer; user-select: none; }
.btn:disabled { cursor: not-allowed; opacity: 0.5; pointer-events: none; }

/* Overlay that doesn't block clicks on content below */
.decorative-overlay { pointer-events: none; }

/* Draggable handle */
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }
💡Interactive cursor states, disabled buttons, and drag handles.
🎯 Interview Key Takeaway

Use pointer-events: none to make overlays click-through and cursor to communicate element interaction modes.

#Cursor#Interaction#UX#Beginner
Back to all CSS & Modern Layouts Questions→

More CSS & Modern Layouts Interview Questions

Beginner LevelCSS & Modern Layouts

What is the CSS Box Model and how do content, padding, border, and margin interact?

Beginner LevelCSS & Modern Layouts

How does CSS specificity and the cascade determine which styles are applied?

Beginner LevelCSS & Modern Layouts

What are the differences between display: block, inline, inline-block, flex, and grid?