caret

The caret CSS property is shorthand for setting caret-color and caret-shape.

Syntax

CSS

caret: value;

JS

object.style.caret = "value";

Values

<'caret'> = <'caret-color'> || <'caret-shape'>
<'caret-color'> = auto | <color>
auto

Automatically specified by the user agent.

<color>

Specifies the color using a keyword or a numerical specification.

<'caret-shape'> = auto | bar | block | underscore
auto

Automatically specified by the user agent.

bar

A thin bar placed at the insertion point.

block

A rectangle overlapping the next visible character following the insertion point.

underscore

A thin line under the next visible character following the insertion point.

Initial

auto

Examples

caret-color | auto

caret-color | color

caret-shape | auto

caret-shape | bar

caret-shape | block

caret-shape | underscore

JS | caret-color

JS | caret-shape

Internal

caret-color

caret-shape

External

World Wide Web Consortium (W3C)

Home Menu