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下则会影响 ...
随机推荐
- Scala的基本语法总结
Scala的函数: 目前博客园中的代码编辑器中还不支持Scala语言....用的Java代码的存储方式 object TestScala { def main(args: Array[String]) ...
- 【技巧性(+递归运用)】UVa 1596 - Bug Hunt
In this problem, we consider a simple programming language that has only declarations of onedimensio ...
- JMS - ExceptionListener
If a JMS provider detects a problem with a connection, it will inform the connection’s ExceptionList ...
- spring分布式事务学习笔记
最近项目中使用了分布式事务,本文及接下来两篇文章总结一下在项目中学到的知识. 分布式事务对性能有一定的影响,所以不是最佳的解决方案,能通过设计避免最好尽量避免. 分布式事务(Distributed t ...
- memcached缓存机制+微软缓存机制使用详解
1. why Memcached 1.1 一台web服务器上,iis接收的请求数是有限的,当访问量超大的时候,网站访问就会遇到瓶颈了,处理方式就是运用多了服务器把请求数分流(集群),对外公布的就一 ...
- edmbed system----ecos
方案公司用的嵌入式系统用的就是开源的可配置系统, ecos 不过提到它,对方公司研究的并不透彻,它有一个可以配置的dhcp部分,也就是dns可以选择不分配给连接的客户端 不过对方公司不这个事,更不知道 ...
- Objective-c中的对象间的消息传递以及消息路由
刚开始使用Objective-C时,总是习惯将对象间发送消息之间称呼为方法调用.心想,这和c#不是一回事吗?不就是调用实例方法吗,还搞个消息发送作甚,最后还不是要转化为方法的调用?通过一段时间的理解学 ...
- iOS开发——锁屏监听
公司所做的项目,锁屏监听是为了60秒后,解锁瓶后显示[手势解锁]或[指纹验证]: 第一步:AppDelegate.m 头部导入 #import <notify.h> #define Not ...
- JQuery AJAX的嵌套使用
<script type="text/javascript"> $(function () { $.post("Ajax/HideHandler.ashx&q ...
- info sed 中文不完全文档
快速指南: sed 的一般使用方法:sed -option 'adress|command' -f scpritfiles(1)'|' 只是用来说明性的分隔 adress 和 command,实际使用 ...