[导入]div+css 有focus高亮效果的文本框_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 12:30:27
原创
1224人浏览过





form ... {
margin: 0px auto;
width: 450px;
border: solid 1px #CCCCCC;
}

.bo ... {
border-bottom: solid 1px #CCCCCC;
}

label ... {
float: left;
padding: 10px 0px 4px 30px;
}

input ... {
padding: 1px;
}

input,textarea ... {
border: 1px solid #CCCCCC;
margin: 5px 0px;
}

textarea ... {
padding: 2px;
}

.bt ... {
width: 38px;
height: 20px;
font-size: 11px;
border: solid 1px #CCCCCC;
background: #FBFBFB;
text-align: center;
}

.btcenter ... {
text-align: center;
clear: left;
padding: 4px 0px 0px;
}

.sffocus ... {
background: #F0F9FB; /**//*----for IE----*/
border: 1px solid #1D95C7;
}

textarea:focus, input:focus ... {
background: #F0F9FB; /**//*----for firefox......----*/
border: 1px solid #1D95C7;
}

body ... {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
margin-top: 20px;
}
style >

function suckerfish(type, tag, parentId) ... {
if (window.attachEvent) ...{
window.attachEvent("onload", function() ...{
var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
type(sfEls);
});
}
}

sfHover = function(sfEls) ... {
for (var i=0; i sfEls[i].onmouseover=function() ...{
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() ...{
this.className=this.className.replace(new RegExp(" sfhover\b"), "");
}
}
}

sfFocus = function(sfEls) ... {
for (var i=0; i sfEls[i].onfocus=function() ...{
this.className+=" sffocus";
}
sfEls[i].onblur=function() ...{
this.className=this.className.replace(new RegExp(" sffocus\b"), "");
}
}
}

sfActive = function(sfEls) ... {
for (var i=0; i sfEls[i].onmousedown=function() ...{
this.className+=" sfactive";
}
sfEls[i].onmouseup=function() ...{
this.className=this.className.replace(new RegExp(" sfactive\b"), "");
}
}
}

sfTarget = function(sfEls) ... {
var aEls = document.getElementsByTagName("A");
document.lastTarget = null;
for (var i=0; i if (sfEls[i].id) ...{
if (location.hash==("#" + sfEls[i].id)) ...{
sfEls[i].className+=" sftarget";
document.lastTarget=sfEls[i];
}
for (var j=0; j if (aEls[j].hash==("#" + sfEls[i].id)) aEls[j].targetEl = sfEls[i];
aEls[j].onclick = function() ...{
if (document.lastTarget) document.lastTarget.className = document.lastTarget.className.replace(new RegExp(" sftarget\b"), "");
if (this.targetEl) this.targetEl.className+=" sftarget";
document.lastTarget=this.targetEl;
return true;
}
}
}
}
}
suckerfish(sfHover, " p " );
suckerfish(sfActive, " p " );
suckerfish(sfHover, " INPUT " );
suckerfish(sfActive, " TEXTAREA " );
suckerfish(sfFocus, " INPUT " );
suckerfish(sfFocus, " TEXTAREA " );
suckerfish(sfTarget, " H5 " );
suckerfish(sfHover, " pre " );
suckerfish(sfActive, " pre " );
script > head >


姓名: label >
div >
电话: label >
div >
主题: label >
div >
内容: label >
textarea > div >

div > form > body > html >


文章来源: http://link-to.cn/post/2007/12/div+css-有focus高亮效果的文本框.aspx
HTML速学教程(入门课程)
HTML速学教程(入门课程)

HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号