Home > Web Front-end > CSS Tutorial > How to add color to input in css

How to add color to input in css

WBOY
Release: 2021-12-02 19:36:08
Original
6893 people have browsed it

Method to add color: 1. Use the color attribute to add font color to the input element, the syntax is "color: color value;"; 2. Use the "background-color" attribute to add the background color to the input element, the syntax is is "background-color: color value;".

How to add color to input in css

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

How to add color to input in css

You can use the color attribute to add font color to the input element, and the background-color attribute to the input element Add background color.

The example is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    input{
        color:#ffffff;
        background-color:#000000;
    }
    </style>
</head>
<body>
    <input type="text">
</body>
</html>
Copy after login

Output result:

How to add color to input in css

##(Learning video sharing:

css video tutorial

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

Related labels:
css
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