The caret-color CSS property sets the color of the insertion caret, the visible marker where the next character typed will be inserted. This is sometimes referred to as the text input cursor. The caret appears in elements such as or those with the
contenteditable attribute. The caret is typically a thin vertical line that flashes to help make it more noticeable. By default, it is black, but its color can be altered with this property.
Note that the insertion caret is only one type of caret. For example, many browsers have a "navigation caret," which acts similarly to an insertion caret but can be moved around in non-editable text. On the other hand, the mouse cursor image shown when hovering over text where the cursor property is auto, or when hovering over an element where the cursor property is text or vertical-text, though it
sometimes looks like a caret, is not a caret [it's a cursor]. /* Keyword values */
caret-color: auto;
caret-color: transparent;
caret-color: currentcolor;
/* values */
caret-color: red;
caret-color: #5729e9;
caret-color: rgb[0, 200, 0];
caret-color: hsla[228, 4%, 24%, 0.8];
/* Global values */
caret-color: inherit;
caret-color: initial;
caret-color: revert;
caret-color: revert-layer;
caret-color: unset;
auto The user agent selects an appropriate color for the caret. This is generally currentcolor, but the user agent may choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors.Try it
Syntax
Values
Note: While user agents may use currentcolor [which is usually animatable] for the auto value, auto is not interpolated in transitions and animations.
The color of the caret.
Formal definition
Formal syntax
caret-color =
auto |
Examples
Setting a custom caret color
HTML
This paragraph can be edited, and its caret has a custom color as well!
CSS
input { caret-color: auto; display: block; margin-bottom: 0.5em; } input.custom { caret-color: red; } p.custom { caret-color: green; }
Result
Specifications
Unknown specification # caret-color |
Browser compatibility
BCD tables only load in the browser
See also
Testbook Edu Solutions Pvt. Ltd.
1st & 2nd Floor, Zion Building,
Plot No. 273, Sector 10, Kharghar,
Navi Mumbai - 410210
[email protected]
Toll Free:1800 833 0800
Office Hours: 10 AM to 7 PM [all 7 days]
Word Processing | act of creating, editing and producing a text document |
Building Blocks | pre-designed blocks of text and formatting which can easily be inserted into documents |
Templates | sample files which contain some formatting and can be customized to serve as a starting point for a new document |
Cursor | black blinking line in the document to show the location where text or objects will be entered |
Insertion Point | location where the text or object will be entered based on the location of the cursor |
Alignment | position of lines in a paragraph in relation to the documents left and right margins |
Word Wrapping | feature which moves a word to a new line to avoid overrunning the margin |
Keyboard Shortcut | key combination which performs certain commands when pressed |
Contiguous Selection | selection of text which is located next to each other or touching in a sequence |
Non-Contiguous Selection | selection of text which is not located next to each other or touching in a sequence |
Selection Bar | narrow strip along the left page margin which automates the selection of text |
Font | complete set of characters in a specific face, style and size |
Font Size | height of an uppercase letter in a font set; measured in points |
Font Style | slant and weight of the characters in a font set |
Font Color | shade of the characters in a font set |
Format Painter | tool which can be used to copy formatting from one location to another in a document |
Clipboard | temporary storage area for items which have been cut or copied in a program prior to being pasted in another location |
Cut | removes selected text and places it on the clipboard |
Copy | makes a duplicate of the text and places it on the clipboard |
Paste | moves items from the clipboard into the document |
Overtype Mode | replaces text to the right of the cursor one character at a time as text is entered |
Spell Check | editing tool which reviews documents for spelling errors and misused words |
Grammar Check | editing tool which reviews documents for grammatical errors |
Thesaurus | editing tool which can be used to identify synonyms and antonyms for a selected term |
File Type | format in which a file is stored |
Non-Printing Characters | symbols which appear on the screen but are not visible on the printed page identifying items such as spaces and paragraph marks |
AutoCorrect | tool which automatically corrects misspellings and common typos |
AutoFormat As You Type | tool which automatically applies common formats to text as it is entered |
Left Alignment | aligns text flush with the left margin |
Center Alignment | centers text between the right and left margins |
Right Alignment | aligns text flush with the right margin |
Justified Alignment | aligns text to run evenly between the left and right margins |
Left Indent | indents from the left margin |
Right Indent | indents from the right margin |
First Line Indent | indents just the first line from the left margin |
Hanging Indent | indents all lines but the first line from the left margin |
Margin | space separating text or objects from the edge of the page |
Themes | sets of coordinated colors, fonts and effects which can be applied to documents |
Style Sets | collections of styles which contain coordinated colors and fonts |
Watermark | graphic object or text positioned behind the text of a document |
Page Orientation | way in which a rectangular page is orientated for normal viewing |
Landscape Orientation | long side of the page runs horizontal |
Portrait Orientation | long side of the page runs vertical |
Soft Page Break | break entered by Word to start a new page when the current page is full |
Hard Page Break | break entered by the user before the current page is full |
Header | text or graphics which are printed at the top of each page in a document |
Footer | text or graphics which are printed at the bottom of each page in a document |
Hyperlink | text or graphic which has been linked to another location |
Table | grid of horizontal rows and vertical columns into which data can be entered to organize information |
Text Box | object in which text can be added and placed anywhere on a page |
Shapes | objects which can be added to documents such as circles, lines, etc. |
WordArt | decorative text which can add to a document |
Screenshot | image of content currently displayed in a window open on the computer or desktop |
SmartArt | graphic object which can be inserted to create diagrams in a document |
Charts | visual representations of data |
Text Wrapping | ability of text to be located around an object |
Captions | labels which identify illustrations such as tables, charts, figures or images located in a document |
Comments | notes which can be electronically entered into documents |
Macro | series of commands and instructions which can be grouped together as a single command to accomplish a task automatically |
Quick Parts | objects such as document properties or fields which can be inserted from a gallery |
File extension | a dot followed by three or four characters at the end of the file name used to show the file type |