How to change input cursor color using css

王林
Release: 2020-10-22 18:23:16
forward
2522 people have browsed it

How to change input cursor color using css

The specific method is as follows:

(Recommended tutorial: css video tutorial)

1. Use color to achieve

The color of the cursor is inherited from the color of the current input box font, so it can be changed using the color attribute:

input{
    color:red;
}
Copy after login

2. Use caret-color to implement the previous method

The cursor color has been modified but the font color has also changed. If you only want to change the cursor color without changing the font color, then use the caret-color attribute:

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

Related recommendations: CSS tutorial

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

Related labels:
source:csdn.net
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