<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="textml; charset=utf-8" />
<title>输入框点击时边框变色效果</title>
</head>
<body>
<style type="text/css">
.focusInput {border:1px solid #99CC33;}
</style>
<script type="text/javascript">
function focusInput(focusClass) {
var elements = document.getElementsByTagName("input");
for (var i=0; i < elements.length; i++) {
if (elements[i].type != "button" && elements[i].type != "submit" && elements[i].type != "reset") {
elements[i].onfocus = function() { this.className = focusClass; };
elements[i].onblur = function() { this.className = ''; };
}
}
}
window.onload = function () {
focusInput('focusInput');
}
</script>
请输入姓名:<input type="text" />
</body>
</html>

input框颜色修该的更多相关文章

  1. 四、Input框改placeholder中字体的颜色

    Input框改placeholder中字体的颜色 input::-webkit-input-placeholder { color: #ccc; font-size: 12px; }

  2. 苹果手机input框上方有一条阴影线以及input框的placeholder颜色的设置

    今天做手机端的时候,用到input框来输入手机号码,但是在安卓手机上input的效果是正常的,在苹果手机上,input的上边框会变粗,有阴影 因为苹果手机的默认给input加上了阴影 给input加入 ...

  3. CSS渐变字体、镂空字体、input框提示信息颜色、给图片加上内阴影、3/4圆

    1.渐变字体 主要是看:-webkit-background-clip: text; 该属性 <style> .b1{ width: 500px; height: 200px; font- ...

  4. input框自动填充内容背景颜色为黄色解决方法

    谷歌浏览器input自动填充内容,背景色会是黄色,想改的话: input:-webkit-autofill { box-shadow: 0 0 0px 1000px white inset;} 这种方 ...

  5. 解决input框中加入disabled="disabled"之后,改变字体的颜色(默认的是灰色)

    在input框中加入disabled="disabled"之后,字体默认的就变成灰色了 解决方案 input[disabled]{color:#fff;opacity:1} dis ...

  6. HTML5 input placeholder 颜色修改示例

    Chrome支持input=[type=text]占位文本属性,但下列CSS样式却不起作用: CSS 复制代码 代码如下: input[placeholder], [placeholder], *[p ...

  7. 使用CSS修改HTML5 input placeholder颜色

    HTML <input type="text" placeholder="Value" /> 有三种实现方式:伪元素(pseudo-elements ...

  8. 使用CSS修改HTML5 input placeholder颜色( 转载 )

    问题:Chrome支持input=[type=text]占位文本属性,但下列CSS样式却不起作用: input[placeholder], [placeholder], *[placeholder] ...

  9. HTML5 input placeholder 颜色 改动

    David Murdoch:Chrome支持input=[type=text]占位文本属性,但下列CSS样式却不起作用: CSS input[placeholder], [placeholder], ...

随机推荐

  1. 安装最新版本的ReSharper导致原生全局搜索工具的消失问题

    经过检测,是由于启用了一个插件导致的,禁用即可,如下图:

  2. javascript判断文件大小

    <input type="file" id="fileName" name ="fileName" onchange="Ge ...

  3. jquery------使用jQuery的委托方法

    index.jsp <div id="gallery"> <div class="photo"> <img src="a ...

  4. MyEclipse------如何在特定目录下创建文件夹

    Directory.jsp <%@ page language="java" import="java.util.*" pageEncoding=&quo ...

  5. iOS项目工作空间搭建

    一般公司的项目都是一个工作空间包包含两个项目,一个主项目,一个Pods项目,当然也有些就是一个项目,然后把第三方放在项目的文件夹里. 这样做的好处是,项目再次拷贝到其他地方报错的可能性小,而且拷完就能 ...

  6. iOS-解决iOS8及以上设置applicationIconBadgeNumber报错的问题

    在IOS7中设置applicationIconBadgeNumber不会有什么问题,但是直接在IOS8中设置applicationIconBadgeNumber会报错.因为在IOS8中要想设置appl ...

  7. cocos基础教程(6)坐标与锚点讲解

    坐标系详解 Cocos2d-x坐标系和OpenGL坐标系相同,都是起源于笛卡尔坐标系.原点为屏幕左下角,x向右,y向上. 世界坐标系(World Coordinate) VS 本地坐标系(Node L ...

  8. Android Toast 封装,避免Toast消息覆盖,替换系统Toast最好用的封装

    Android Toast 封装,避免Toast消息覆盖,无阻塞,等强大功能   ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

  9. rails命令避免直接操作数据库

    文章是从我的个人主页上粘贴过来的, 大家也可以访问我的主页 www.iwangzheng.com 今天在数据库里新增人员的时候出了点小问题,有人员重复了,以至于要删除一些,大师和pp指导完成的. $r ...

  10. Correlation Filter in Visual Tracking

    涉及两篇论文:Visual Object Tracking using Adaptive Correlation Filters 和Fast Visual Tracking via Dense Spa ...