CSS caret-color Property
Description
The caret-color property controls the color of the text insertion cursor (also known as the caret) in editable elements such as text inputs, textareas, and elements with contenteditable enabled. The caret is the blinking vertical line that indicates where the next character will appear as the user types.
By default, browsers automatically choose a caret color that matches or complements the text color. However, caret-color allows you to override this behavior, giving you full control over how the caret appears within form fields or editable content. This can be especially useful when working with custom themes, dark mode designs, or high-contrast user interfaces where the default caret color may be difficult to see.
Using caret-color, you can improve accessibility and usability by ensuring the caret remains clearly visible against various background colors. For example, when using dark backgrounds with light text, adjusting the caret color can prevent it from blending in or becoming distracting.
The property applies to elements that accept text input, such as:
<input>elements (text-based types)<textarea>- Elements using
contenteditable="true"
It does not affect static text or non-editable elements.
In modern UI design, caret-color is often used alongside custom focus styles, animated inputs, or themed form components to maintain visual consistency. It can also enhance user experience by subtly reinforcing brand colors without overwhelming the interface.
Definition
- Initial value
- auto
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- auto is computed as specified and <color> values are computed as defined for the color property.
- Animatable
- Yes
- JavaScript syntax
- object.style.caretColor
Interactive Demo
Enter text in the field below to see example.
Syntax
caret-color: auto | <color>
Values
- autoBrowsers use currentColor . Browsers can also automatically adjust the color of the carriage to provide good visibility and contrast with the surrounding content, based on currentColor , background, shadows, etc.
- <color>The color of the caret.
Example
Browser Support
The following information will show you the current browser support for the CSS caret-color property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
