Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

cursor — cursor appearance

The cursor property specifies the pointing-device cursor over an element. It accepts a keyword or images followed by a mandatory fallback keyword.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

cursor: [ <cursor-image>, ]* <cursor-predefined>;
/* Common declarations */
cursor: auto;
cursor: pointer;
cursor: url("cursor.png") 4 4, pointer;

cursor is inherited; its initial value is auto. auto chooses a contextual cursor, default selects the platform default, and none hides it.

pointer signals a link; text signals text selection. progress indicates processing with interaction available; wait indicates waiting. Cursor appearance alone does not implement these behaviors.

Images supplied through url() are tried in order; the final keyword is mandatory. Two optional numbers specify the image hotspot. The browser may override the cursor, for example over native controls.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Cursor example</title>
<style>
  .area {
    padding: 2rem;
    border: 2px solid;
    cursor: crosshair;
  }
</style>
<div class="area">Move the pointer here.</div>
</html>

Result

The bordered area requests a crosshair cursor while the pointer is over it; its exact appearance depends on the platform.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources