tags:

views:

43

answers:

2

I want to set the background color of Input Box to Cyan when it gets focus and to White when it looses focus. I want to define this in a CSS file. While writing the CSS code, I searched for the OnFocus and OnBlue events, but didn't find. Please let me know how to define these properties within this code block:

input.entryFormColor
{

}
+1  A: 

Try something like:

input.entryFormColor { background: white; }
input.entryFormColor:focus { background: cyan; }

Check out http://www.w3schools.com/CSS/pr%5Fpseudo%5Ffocus.asp for more info.

Darren Oster
+1  A: 

You could use the :focus pseudo-class, however it won't work in all browsers (like IE6).

input.entryFormColor:focus { 
    background: cyan;
}
ILMV