代码示例:(标识:cssref_caret-color)
<!DOCTYPE html>
<html>
<head>
<style>
.example1 {
  caret-color: red;
}

.example2 {
  caret-color: transparent;
}
</style>
</head>
<body>

<h1>caret-color 属性</h1>

<input value="默认的 caret color"><br><br>

<input class="example1" value="自定义的 caret color"><br><br>

<input class="example2" value="透明的 caret color">

<p contenteditable class="example1">此段落可以编辑。其插入符号也有自定义颜色。</p>

</body>
</html>
运行结果: