Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background color in input and text fields

Tags:

css

I would like to change the color background in the text and input fields of a form, but when I do this it also affects the submit button! Could it be done in some other way that does not affect the button?

I have used this code:

input, textarea {   background-color: #d1d1d1; } 
like image 765
3D-kreativ Avatar asked Apr 11 '11 06:04

3D-kreativ


People also ask

How do you put a background color in input field?

To add background color to the form input, use the background-color property.

How can I set text background color in HTML?

To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.

How do you change the background of a text field?

Here is the step by step instructions: Step 1: Locate the file where you have placed the TextField widget. Step 2: Inside the TextField widget, add the decoration parameter and assign the InputDecoration widget. Step 3: Inside the InputDecoration widget, add the filled parameter and set it to true .

How do you change the color of text input?

<input type="text" placeholder="A red placeholder text..">


1 Answers

input[type="text"], textarea {    background-color : #d1d1d1;   } 

Hope that helps :)

Edit: working example, http://jsfiddle.net/C5WxK/

like image 178
Damien-Wright Avatar answered Oct 07 '22 17:10

Damien-Wright