Conceal the cursor in a text input field

I'm looking to add a Linux-inspired command line interface to my HTML/CSS website. I've created a Span element and now I want to include a Textarea next to it for user input simulation. However, I'm struggling to remove the blinking caret in the textarea. Does anyone have any suggestions on how I can hide the caret?

Preferably, I'd like to achieve this using only HTML/CSS.

#name {
  position: absolute;
  left: 0;
  width: 100%;
  padding: 5%;
  color: rgb(0, 255, 0);
  /*text-align: center;*/
  font-family: "Lucida Console";
  font-size: 50pt;
}

blink {
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0% {
    visibility: hidden;
  }
  40% {
    visibility: hidden;
  }
  50% {
    visibility: visible;
  }
  90% {
    visibility: visible;
  }
  100% {
    visibility: hidden;
  }
}
<div id="name"><span>nicolo@luescher:~$<blink>_</blink></span></div>

Answer №1

To achieve a font color that appears transparent, you can utilize the text-shadow property along with setting the color to be transparent in a textarea. This will allow users to write in the textarea without seeing the cursor.

Here is an example of how this can be implemented:

textarea {
  color: transparent;
  text-shadow: 0px 0px 0px silver;
}
<textarea placeholder="Write here"></textarea>

Answer №2

Latest info for 2022:

textarea {
  caret-color: transparent;
}

All modern browsers now fully support this feature including Chrome 57+, Edge, Firefox 53+, and Safari 11.1+

For detailed information, please refer to the MDN Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/caret-color

To check browser compatibility, visit caniuse at: https://caniuse.com/?search=caret-color (94.53% as of latest data)

textarea{
width:300px;
height:60px;
}


textarea{
caret-color: transparent;
}
<textarea placeholder="Start typing here">Hello World</textarea>

Answer №3

Previously, I would implement the following:

   input:hover{
     cursor: none; 
    }

The purpose is to hide the cursor in the designated input field :)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can XPath be used to target a specific parent element?

After reviewing the material, I am led to believe that it may not be feasible; however, I will present the following scenario just in case: Consider the following oversimplified HTML structure (derived from a CMS-generated HTML, hence limited control) < ...

Executing an on-click event on a button in PHP

I've been developing a learning site that involves teachers, students, and different subjects. To organize the registration process, I decided to separate the teacher and student registration pages since they input data into different tables in the da ...

Activate simultaneous HTML5 videos on iOS devices with a simple click

I am currently in the process of developing a webpage that will play various videos when specific elements are clicked. Although the functionality works perfectly on desktop computers, it encounters an issue on iOS devices. The problem arises when the elem ...

The margin and width of a div element with the position set to fixed and display set to table-cell are not rendering correctly

Is there a way to keep my .nav-container position: fixed; without creating a gap between it and the .page-content at certain window widths? When I set the position to fixed, a small white line appears between the red background of the .nav-container and th ...

The datetime-picker from Twitter Bootstrap is not accurately displayed within a modal

Utilizing the twitter bootstrap datetime-picker in conjunction with Ruby on Rails has been a seamless experience for me. However, I have encountered a small issue when displaying it within a modal at the bottom of the screen. HTML <div id="datetimePic ...

Utilize Javascript to access and manipulate the input using the document

I have an input validator that checks if a user's email and username are not already registered on the website. My code looks like this: Javascript: $(document).ready(function() { $('#email').blur(function(event) { $.get(Ba ...

Including a logo and navigation bar in the header while collaborating with different subregions

I'm having trouble getting a picture to display in the header alongside a horizontal menu. I've divided the header into two sections: img and navbar (html). The navbar is showing up correctly, but the image isn't appearing. Any suggestions o ...

Create an animation that transitions a line from 0% width to 100% width, moving from left to right

Desiring to create a pseudo-element line that expands from left to right across its container, then contracts from right to left back to zero width. Note: in my JavaScript code, I apply the "underlined-animated" class after a specific timeout. I've e ...

Using a Custom Variable in PayPal Email Links

Currently, I am developing a compact integrated application for a project that does not involve using a form. In this particular project, the use of HTML is not necessary and instead, only a link can be passed to the browser. The purpose of this link is to ...

AngularJS encountered an error: The token '|' was unexpected and expected ':' instead

My HTML file contains a condition where certain fields need to be displayed automatically in landscape mode using filters. However, when I run the program, I encounter the following code: <tbody> <tr ng-repeat="ledger in vm.ledgers ...

executing tasks on a sql database with php

Currently, I am delving into the realm of SQL and have devised a table named products. This table consists of columns such as item, price, base, and wholesale. My goal is to enable users to input a number (let's say 15) which signifies their desire t ...

Issues with escaping HTML encoding

Currently working on an Android app that involves querying a webservice and receiving a JsonObject. Once I have the desired String, I encounter characters like: est&amp;aacute; I've experimented with two methods: StringEscapeUtils.escapeHTML4(te ...

Tips for keeping a reading item in place while scrolling

To enhance the user experience, I would like to improve readability without affecting the scroll position. Question: Is there a way to fix the scrolling item at a specific position (item with the .active class)? I am looking to maintain a consistent read ...

Unveiling the Mystery: Why YUI-3 Grids & Google Chrome Cause Overlapping Texts

Although I'm not well-versed in UI design, I find myself having to work on some CSS for a side project. Currently, I am utilizing YUI-3 files such as grids, reset, and fonts, all version 3.9.1. The main issue I am encountering is that the text inside ...

Changing the placement of navbar components in Bootstrap 4 based on screen size

Through the use of Bootstrap 4, I have successfully created a navbar that collapses into a button when the screen size decreases. However, I am facing an issue where one item (the icon image) gets centered while the rest of the items are aligned to the lef ...

What is the best way to align a div and two buttons with respect to an image within an li element?

I am trying to adjust the positioning of text on top of an image with a 40px margin. Additionally, I want to place two buttons on each side of the list item (one on the right and one on the left). Despite numerous attempts with various solutions, including ...

Customizing Big Cartel's Neat theme: A guide to eliminating the blur effect on featured product images upon site activation

My website is built on Big Cartel using the Neat theme. Every time the homepage loads, the Featured products images appear blurry for about 4 seconds, especially if you're not using Chrome browser. Is there a way to remove this blur effect? Thank yo ...

Interactive pop-up messages created with CSS and JavaScript that appear and fade based on the URL query string

I have a referral form on this page that I want people to use repeatedly. After submitting the form, it reloads the page with the query string ?referralsent=true so users can refer more people through the form. However, I also want to show users a confir ...

Tips for creating an input field that automatically expands and has a specific width

I am facing an issue with the alignment of my search field. Here is the code snippet: #menu_search{ position: absolute; width: 100%; max-width: 1280px; display: inline; float: right; right: 0px; z-index: 99; } I would like th ...

Displaying a vertical arrangement of collapsed menu items with a centered navbar and logo positioned at the center of it (using bootstrap)

I'm currently working on a website that features a centered navbar with a logo also centered inside it. The tech I'm using is Bootstrap and LESS. Issue When the navbar collapses on mobile/tablet view, the menu items are displayed horizontall ...