Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

How to hide the insertion caret in a webpage using CSS ?

  • Last Updated : 01 Aug, 2021

Insertion caret or text input cursor generally refers to a flashing, thin vertical line. It functions in an input field to indicate where the next character typed will be inserted.

If you wish to hide this input cursor from input fields in your webpage, the caret-color property of CSS is used. It has three property values including auto, color, and transparent. In this article, we’ll focus on the transparent value. 


caret-color: transparent;

Example: The following example hides the text input cursor using CSS.


<!DOCTYPE html>
    <title>Hide insertion caret</title>
        body {
            text-align: center;
        .hidden {
            caret-color: transparent;
    <h2 style="color:green;">Welcome To GFG</h2>
    <h2> Visible Input Text Cursor </h2>
    <input type="text"><br><br>
    <h2> Hidden Input Text Cursor Using
        <b>transparent</b> value
    <input type="text" class="hidden">


Hide cursor

My Personal Notes arrow_drop_up
Recommended Articles
Page :