WEB教程基地:www.91ctc.com为你搭建学习WEB技术的优秀平台
在线留言 网站地图 加入收藏 设为首页
您的位置:本站首页>>前端样式>>使用CSS为文本框添加阴影效果,input发光效果

使用CSS为文本框添加阴影效果,input发光效果

[ 录入者:91ctc | 时间:2015-06-03 15:48:37 | 作者: 91ctc| 来源:本站原创 | 浏览: 次 ]


分享小编常用的CSS为文本框添加阴影效果,也就是input发光效果

input:focus,textarea:focus {
    outline: 0;
    border-color: rgba(82, 168, 236, 0.8);
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
    -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
}
input, textarea, select {
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
    box-shadow: 2px 2px 2px #F0F0F0 inset;
    font-family: inherit;
    font-size: 100%;
    line-height: 18px;
    padding: 4px;
    margin: 0;
    vertical-align: middle;
    -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
    -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
    -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
    -o-transition: border linear 0.2s, box-shadow linear 0.2s;
    transition: border linear 0.2s, box-shadow linear 0.2s;
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius:3px;
}

很明显这不兼容IE,凡是使用webkit核心的浏览器都兼容。

效果图:

使用CSS为文本框添加阴影效果,input发光效果


关闭】【返回顶部

相关文章
{xiangguan_list}
91ctc.com 网络先锋,引领科技,本站原创作品[转载请注明出处]。联系我们
Copyright© 2010-2017 计算机教程中心网 . All rights reserved. 苏ICP备11081842号