input输入框的各种样式
输入框景背景透明:
<input style="background:transparent;border:1px solid #ffffff">
鼠标划过输入框,输入框背景色变色:
<INPUT value="Type here" NAME="user_pass" TYPE="text" SIZE="29" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 21" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black">
输入字时输入框边框闪烁(边框为小方型):
<Script Language="JavaScript">
function borderColor(){
if(self['oText'].style.borderColor=='red'){
self['oText'].style.borderColor = 'yellow';
}else{
self['oText'].style.borderColor = 'red';
}
oTime = setTimeout('borderColor()',400);
}
</Script>
<input type="text" id="oText" style="border:5px dotted red;color:red" onfocus="borderColor(this);" onblur="clearTimeout(oTime);">
输入字时输入框边框闪烁(边框为虚线):
<style>
#oText{
border:1px dotted #ff0000;ryo:expression(onfocus=function light (){
with(document.all.oText){
style.borderColor=(style.borderColor=="#ffee00"?"#ff0000":"#ffee00");
timer=setTimeout(light,500);
}
},
onblur=function(){
this.style.borderColor="#ff0000";clearTimeout(timer)
})};
</style>
<input type="text" id="oText">
自动横向廷伸的输入框:
<input type="text" style="huerreson:expression(this.width=this.scrollWidth)" value="abcdefghijk">
自动向下廷伸的文本框:
<textarea name="content" rows="6" cols="80"
onpropertychange="if(this.scrollHeight>80)
this.style.posHeight=this.scrollHeight+5">输入几个回车试试</textarea>
只有下划线的文本框:
<input style="border:0;border-bottom:1 solid black;background:;">
软件序列号式的输入框:
<script for="T" event="onkeyup">
if(value.length==3)
document.all[event.srcElement.sourceIndex+1].select();
</script>
<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T7" size="5" maxlength="3">
软件序列号式的输入框(完整版):
<script for="T" event="onkeyup">
if(value.length==maxLength)
document.all[event.srcElement.sourceIndex+1].focus();
</script>
<script for="T" event="onfocus">select();
</script>
<script for="Submit" event="onclick">
var sn=new Array(); for(i=0;i<T.length;i++) sn=T.value;
alert(sn.join("—"));
</script>
<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
—<input name="T" size="5" maxlength="3">
<input type="submit" name="Submit">
input输入框的各种样式的更多相关文章
- input输入框外联式样式控制不了字体
1.问题背景 在做项目过程中,发现input输入框利用外联样式,控制不了输入框的样式 2.问题原因 (1)HTML代码 <!DOCTYPE html> <html> <h ...
- 手机端实现6位短信验证码input输入框效果(样式及代码方法)
微信移动端4位.6位.多位验证码密码输入框功能的实现代码,实现思路: 方案1: 写一个简单的input框. 评估:样式不好看,待定. 方案2: 就是用6个input框,每输入一个数字之后,切换到下一个 ...
- 修改input输入框的样式
直接上代码 <style> .input{ -web-kit-appearance:none; -moz-appearance: none; font-size:1.4em; height ...
- css样式之input输入框默认样式
帮朋友写个简单的课程设计,后面会贴出来,项目刚开始就遇到一个坑(给input输入框设定样式,但是,点击后会出现蓝色边框),之前写其他的项目时也遇到过,百度一下资料解决了,现在又碰到了,写一下,留着备用 ...
- (谷歌浏览器等)解决css中点击input输入框时出现外边框方法【outline:medium;】
问题:在使用谷歌浏览器,360浏览器时,点击input输入框会出现带颜色的外边框,如下图所示:
- MVC4怎么设置@Html.TextBoxFor这样的输入框的css样式
在传统webForm中,输入框的这样的: <input id="userName" name="userName" type="text&quo ...
- 认识input输入框的placeholder属性
我们来认识下input输入框的placeholder属性. placeholder 属性提供可描述输入字段预期值的提示信息.(placeholder 属性适用于以下的 <input> 类型 ...
- CSS设置input placeholder文本的样式
placeholder是HTML5 input的新属性,英文意思是占位符,它一般表示input输入框的默认提示值. 下面是设置placeholder的文本样式的选择器的示例: /* webkit 浏 ...
- input输入框和 pure框架中的 box-sizing 值问题
在使用pureCSS框架的时候,遇到一个问题. input输入框,我给他们设置了宽度和padding值,我发现,在火狐和谷歌上面发现,增加padding值并不会影响最终的宽度,而在IE6 7下则会影响 ...
随机推荐
- iOS开发者如何提高自己的水平(转)
阅读. 把一大堆的知识塞进脑子里.随着时间流逝,终归有一些会留在脑海里.我觉得有些东西读起来还挺有意思,那么也能算作一种愉快的消遣. 分析. 多去熟悉并了解一些工具,从高层的到底层的,不要害怕去使用他 ...
- Linux 文件/文件夹操作命令
1 cd命令 命令格式:cd [目录名] (cd和目录之间使用空格隔开) cd 进入用户主目录: cd ~ 进入用户主目录: cd - 返回进入此目录之前所在的目录: cd ...
- .NET 认识
- Commons Math - Primes
org.apache.commons.math3.primes.Primes 是关于质数操作的工具类. 1. public static boolean isPrime(int n) 判断 n 是否为 ...
- 浅谈.NET中加密和解密的实现方法分享
这篇文章介绍了.NET中加密和解密的实现方法,有需要的朋友可以参考一下 .NET将原来独立的API和SDK合并到一个框架中,这对于程序开发人员非常有利.它将CryptoAPI改编进.NET的Syste ...
- MVC5----用户登陆及验证码
随便写写记录一下学习的过程 登陆 Models中添加添加 public class LoginViewModel { [Required(ErrorMessage = "*")] ...
- 前端笔记——获取url里面的参数值
备注 var url=window.location.href;//获取地址栏 url var index=url.indexOf('#');//获取#的位置 var paramVal=url.sub ...
- ClassLoader源码
最近找工作,面试网易和微策略,都问到了ClassLoader这个东西,看来应该是比较重要的,所以在这总结一下,嗯,类源码有点长,慢慢看吧. 翻译一下,不当之处欢迎指正. /** * A class l ...
- Using OpenCV Java with Eclipse
转自:http://docs.opencv.org/trunk/doc/tutorials/introduction/java_eclipse/java_eclipse.html Using Open ...
- 使用UDP进行数据发送的实例一
首先如果TCP学过以后,再看UDP进行数据传输也是大同小异的,只是用到的类不同 UDP进行传输需要DataSocket和Datapacket类,Datapacket叫数据报,每一个数据报不能大于64k ...