Page 1 of 1

How to change text field background color only for placeholder text?

Posted: Thu Nov 03, 2016 1:00 pm
by prohor
I want to change text fields background color only for placeholder text. What will change from "green" to "white" when any text is inserted. I want to keep it different when mouse over it. I wrote a code but text field's background color get's back to geen again after cursor taking away after text insertion.

I have a input box in html form

Code: Select all

<input type="text" id="Editbox4" style="position:absolute;left:50px;top:458px;width:328px;height:30px;line-height:26px;z-index:4;" name="phone" value="" placeholder="Enter Phone Number" >
and for css properties

Code: Select all

background-color: green;	
color : yellow;
background-color: #FFFFFF;
color: #000000;	
background-color: white; }

What is wrong, how to fix? Please help.