caret-color¶
Свойство caret-color
задает цвет текстового курсора в полях ввода, например, input
или textarea
.
Интерфейс
Синтаксис¶
/* Keyword values */
caret-color: auto;
caret-color: transparent;
caret-color: currentColor;
/* <color> values */
caret-color: red;
caret-color: #5729e9;
caret-color: rgb(0, 200, 0);
caret-color: hsla(228, 4%, 24%, 0.8);
Значения¶
Значение по-умолчанию:
caret-color: auto;
Применяется ко всем элементам
Спецификации¶
Поддержка браузерами¶
Описание и примеры¶
<input value="This field uses a default caret." size="64" />
<input class="custom" value="I have a custom caret color!" size="64" />
<p contenteditable class="custom">
This paragraph can be edited, and its caret has a custom color as well!
</p>
input {
caret-color: auto;
display: block;
margin-bottom: 0.5em;
}
input.custom {
caret-color: red;
}
p.custom {
caret-color: green;
}