Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Caret Color in Contenteditable div

Tags:

html

css

Can I change the caret color inside a content editable div.
Cursor color is always same as text color, red in my case. So my question is that is there a way to change the caret color to black? eg caret-color:black HTML:

<div class="red" contenteditable="true"> hello </div>

css:

.red{
   color:red;
  }

Check this link

like image 429
Vishu238 Avatar asked Oct 20 '22 03:10

Vishu238


1 Answers

Yes. Use modern CSS!

div {
    caret-color : black;
}
like image 108
Gibolt Avatar answered Oct 22 '22 00:10

Gibolt