cursor — CSS Technical Interview Questions & Answers
Choosing the mouse pointer shown over an element.
cursor
- Choosing the mouse pointer shown over an element.
- cursor is a CSS property: it changes how a selected element looks or sits. You write it inside a rule: .card { cursor: …; }
- Change one value, refresh, say what moved: colour, space, size, or stacking. That is how you learn properties — not by memorising the spec.
- Trap: putting it on the wrong selector (parent vs child). Trap: px only on a phone page — learn rem/%/flex too when it is layout.
- Box model reminder: width/height, padding, border, margin are different. If cursor is about space, draw the box.
Technical Interview Tip: cursor: one rule on .card, then say what changed.
Code Examples for cursor
cursor — working example
.link { cursor: pointer; }
.busy { cursor: wait; }
.disabled {
cursor: not-allowed;
opacity: 0.6;
}
.grab { cursor: grab; }cursor sets the mouse pointer hint; pointer is common for clickable controls.
How to Explain cursor to an Interviewer
What does cursor do?
A CSS property that changes look/layout Write it in a rule and refresh