Cursors, selection and pointer events in CSS
The small properties that decide how a surface feels under the mouse.
.button { cursor: pointer; }
.button:disabled { cursor: not-allowed; opacity: 0.6; }
.overlay-decoration {
pointer-events: none;
position: absolute;
inset: 0;
}
.line-number { user-select: none; color: #94a3b8; }
::selection {
background: #bfdbfe;
}
How it works
cursornames the shape;not-allowedis the honest one for a disabled control.pointer-events: nonemakes an element invisible to the mouse but not to the eye.user-select: nonestops a UI label being selected along with the text.
Keywords and builtins used here
backgroundbuttoncolorcursorinsetopacityposition
The run, in numbers
- Lines
- 14
- Characters to type
- 252
- Tokens
- 58
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 46 seconds.
Step 3 of 3 in Styling content, step 25 of 26 in Selectors & the box model.