138 of 313 menu

The caret-color property

The caret-color property sets a color of the text cursor in the input that appears when entering text. The property can take two values: auto (default) and the user-selected color.

Syntax

selector { caret-color: auto or color; }

Example

Let's set the default text cursor color:

<input> input { padding: 5px; caret-color: auto; }

:

Example

Now let's recolor the text cursor blue:

<input> input { padding: 5px; caret-color: blue; }

:

See also

  • the :fullscreen pseudo-class
    that styles elements in full screen mode
  • the :indeterminate pseudo-class
    that styles switches that are in an indeterminate state
  • the :focus-within pseudo-class
    that styles the elements in focus
byenru