Changing caret color with CSS

With all of the fun stuff that you can do in CSS, you can even change the caret color: that’s right.
Caret is a thin blinking line that appears inside inputs, textboxes, etc.

Just with one line of CSS:

.selector {
caret-color: red;
}

And…


This content originally appeared on DEV Community and was authored by Shivam Jha

With all of the fun stuff that you can do in CSS, you can even change the caret color: that's right.
Caret is a thin blinking line that appears inside inputs, textboxes, etc.

Image description

Just with one line of CSS:

.selector {
  caret-color: red;
} 

And the support is basically universal too! (~94% at the time of writing this post)


This content originally appeared on DEV Community and was authored by Shivam Jha


Print Share Comment Cite Upload Translate Updates
APA

Shivam Jha | Sciencx (2022-01-05T19:40:07+00:00) Changing caret color with CSS. Retrieved from https://www.scien.cx/2022/01/05/changing-caret-color-with-css/

MLA
" » Changing caret color with CSS." Shivam Jha | Sciencx - Wednesday January 5, 2022, https://www.scien.cx/2022/01/05/changing-caret-color-with-css/
HARVARD
Shivam Jha | Sciencx Wednesday January 5, 2022 » Changing caret color with CSS., viewed ,<https://www.scien.cx/2022/01/05/changing-caret-color-with-css/>
VANCOUVER
Shivam Jha | Sciencx - » Changing caret color with CSS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/05/changing-caret-color-with-css/
CHICAGO
" » Changing caret color with CSS." Shivam Jha | Sciencx - Accessed . https://www.scien.cx/2022/01/05/changing-caret-color-with-css/
IEEE
" » Changing caret color with CSS." Shivam Jha | Sciencx [Online]. Available: https://www.scien.cx/2022/01/05/changing-caret-color-with-css/. [Accessed: ]
rf:citation
» Changing caret color with CSS | Shivam Jha | Sciencx | https://www.scien.cx/2022/01/05/changing-caret-color-with-css/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.