表单控件样式简单用例

 在很多文件和有很多的文本框的时候,我想在style.css文件中写上修饰文本框的样式,那么就能只要在每个文件中有:  
  <style   type="text/css">  
  <!--  
  @import   url("css/style.css");  
  -->  
  </style>   
  这样这个文件中的所有文本框都能统一的得到修饰

 

CSS中写:  
  INPUT  
  {  
  behavior:url('Input.htc');          
  }  
  Input.htc中内容://如果有特殊用途的INPUT存在可以判断className  
  <script   language=javascript>  
  switch(type)  
  {  
  case   'text':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#FFFFFF";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  case   'password':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#DEE3BD";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  case   'submit':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#DEE3BD";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#FF0000";  
  break;  
  case   'reset':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#DEE3BD";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  case   'button':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#DEE3BD";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  case   'file':  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#FFFFFF";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  default:  
  style.border="1px   solid   #000000";  
  style.backgroundColor="#DEE3BD";  
  style.height="15px";  
  style.font="normal   9pt   宋体";  
  style.color="#000000";  
  break;  
  };  
  οnmοusedοwn=function()  
  {  
  style.color="#0000FF";  
  };  
  οnmοuseοver=function()  
  {  
  style.color="#0000FF";  
  };  
  οnmοuseοut=function()  
  {  
  if(type=="submit")  
  {style.color="#FF0000";}  
  else  
  {style.color="#000000";}  
  };  
  </script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值