日期:2014-05-20  浏览次数:20406 次

TextBox与CssClass问题: .test:focus{background-color : Red}
我设了TextBox的cssclass为test,请问这样为什么不能实现textbox取得焦点后背景变色?

------解决方案--------------------
取得焦点的事件要在js里捕获的吧
------解决方案--------------------
<input type= "text " id= "Text1 " style= "border:red 1px solid " onfocus= "this.style.backgroundColor= '#f7f7de ';this.style.border= 'green 1px solid '; " onblur= "this.style.backgroundColor= '#FFFFFF ';this.style.border= 'red 1px solid ' " />

------解决方案--------------------
ie 不支持 ,firefox支持