The following will display a crosshair over the checkbox:
input:read-only {
cursor: crosshair;
}
<input type="checkbox">
Why does this happen?
The following will display a crosshair over the checkbox:
input:read-only {
cursor: crosshair;
}
<input type="checkbox">
Why does this happen?
2
Answers
Here’s what the specification has to say:
readonly
doesn’t apply to checkboxes:So even though it might seem a bit weird on the surface, it’s intended behavior:
:read-only
/:read-write
refer to a more specific type of “writable”."The
:read-only
CSS pseudo-class represents an element (such as input or textarea) that is not editable by the user."See also https://developer.mozilla.org/en-US/docs/Web/CSS/:read-only
checkboxes are not editable in any state…