Home > Web Front-end > CSS Tutorial > How to hide the cursor in css input

How to hide the cursor in css input

青灯夜游
Release: 2021-11-19 17:55:43
Original
3887 people have browsed it

In CSS, you can use the caret-color attribute to set the color of the cursor in the input to be transparent, thereby achieving the effect of hiding the cursor. The syntax is "input{caret-color:transparent;}".

How to hide the cursor in css input

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

In the project, I encountered a requirement to hide the cursor of the input box, but also have the input function. How to do this?

It's actually very simple. You just need to use the caret-color attribute to set the color of the cursor in the input to transparent.

<input type="text" />

input{
	caret-color:transparent;
}
Copy after login

How to hide the cursor in css input

Description: The

caret-color attribute specifies the color of the cursor (caret) in inputs, textareas, or any editable element.

Syntax:

caret-color: auto|color;
Copy after login
  • auto: Default. Browsers use currentColor for the caret.

  • #color: Specifies the color used for the caret. All legal color values ​​can be used (rgb, hex, named colors, etc.).

(Learning video sharing: css video tutorial)

The above is the detailed content of How to hide the cursor in css input. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template