开发者

Set input box color settings in CSS file

开发者 https://www.devze.com 2022-12-10 20:03 出处:网络
I want to set the background color of Input Box to Cyan w开发者_StackOverflowhen 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 sea

I want to set the background color of Input Box to Cyan w开发者_StackOverflowhen 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
{

}


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

input.entryFormColor:focus { 
    background: cyan;
}


Try something like:

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

Check out http://www.w3schools.com/CSS/pr_pseudo_focus.asp for more info.

0

精彩评论

暂无评论...
验证码 换一张
取 消