动态更改textbox控件的背景色时出现的小问题
CSS样式:
#UserName{
border-style:solid;border-width:1;
}
控件:
<asp:TextBox ID="UserName" runat="server" Width="160"></asp:TextBox>
代码:
protected void Page_Load(object sender, EventArgs e)
{
UserName.Attributes.Add("onmouseover", "this.style.background='#FDE8FE';");
UserName.Attributes.Add("onmouseout", "this.style.background='#FFFFFF';");
UserName.Attributes.Add("onfocus", "this.select();");
}
背景色可以改变,但是刚开始运行的时候,边框是很细的,鼠标移上去,再离开,就是发生了onmouseover和onmouseout之后,边框就变得又粗又黑了
这是怎么回事儿?