Caret Color Property

Last updated: 2026-09-13

caret-color Caret Color Property

The caret-color property sets the color of the caret — the blinking vertical bar — in editable elements such as inputs and text areas. Customizing the caret color lets form elements match the page palette or highlights the current input position.

Category
Initial Valueauto
InheritedYes
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

caret-color: auto | <color>;

⚙️ Values

ValueTypeDescription
autoKeywordThe default caret color
<color>TypeThe caret color

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
caret-color v57 v12 v52 v10.1 v44
Supported in all major browsers
Tip: auto is the default and usually matches the element's text color; setting a specific color overrides it independently.
Tip: caret-color is an inherited property, so you can set it once on a parent and children inherit the color.

❓ FAQ

QWhich color formats does the caret-color property support in CSS?
AAll CSS color formats: keywords (red, blue), hex (#3498db), rgb()/rgba(), hsl()/hsla(), and special values like currentColor. auto is the default, making the caret follow the element's text color. It also supports transitioning the color via animation, although that is rarely used in practice.
QWhat is the difference between caret-color and cursor in CSS?
Acaret-color sets the color of the text caret (the blinking vertical bar) inside inputs and text areas — editable content. cursor sets the shape of the mouse pointer when hovering over an element — pointer-device feedback. The names sound similar, but the objects are completely different: one is the content caret, the other the mouse pointer.
QWhy is the caret-color property not having any effect on input?
ACheck that it is applied to an editable element (input, textarea, or a contenteditable element) — plain non-editable text has no caret. Also, in forced appearance modes like high-contrast system themes, the browser may override custom colors. All major browsers (Chrome, Firefox, Safari, Edge) support it, but older Safari versions have partial support for some syntax.
QCan the caret-color property be applied to contenteditable elements?
AYes. contenteditable elements have a text caret just like input and textarea, so caret-color works there too — you can give rich-text editors and editable headings a unified caret color that fits your design system. It is an inherited property: set it on the parent container and children inherit the color.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏