How to change the color of the text entered in the input?

1

I have a input and when I type something in it the text will have the same background color (white).

Does anyone know how I can edit this? I would like to put color black .

    
asked by anonymous 27.06.2017 / 15:15

3 answers

6

Just put the color attribute as black , here are two examples of how to change the color of input ,

Example: text with black color

input{
  color: black;
}
<input type="text">

Example: text with red color

input{
  color: red;
}
<input type="text">
    
27.06.2017 / 15:20
2

It's simple, just put the CSS attribute color of the input with the color you want. For text box type inputs, the color property refers to the color of the text.

Something like:

input { color: white }

Or

input { color: #ffffff } /* forma pedante */

With jQuery:

$("input").css("color", "white");

You can also use more specific selectors, such as a class, or the input identifier.

    
27.06.2017 / 15:21
2

Just use color in CSS:

<input type="text" style="color: black;">
    
27.06.2017 / 15:19