明霞山资源网 Design By www.htccd.com
最近做微信端的页面遇到了一个之前没有遇到过的一个页面,刚开始放在那没有去写,可是等其他页面都写好的时候,还是得回过头来研究这个页面问题,刚开始我请教了公司的移动研发,从他那里得到启发,最终实现了这个效果,先把效果图展示出来给大家看看
效果图:
输入验证码
输入完毕
下面就把实现过程奉献给大家
第一步:编写HTML代码
<div class="main-out"> <p class="identifying-title">输入企业提供的验证码,即可完成签到</p> <!--黑色横线框--> <div class="pass-box"> <div class="pass-line"> <div class="line-box"><span class="line line-one"></span></div> <div class="line-box"><span class="line line-two"></span></div> <div class="line-box"><span class="line line-three"></span></div> <div class="line-box"><span class="line line-four"></span></div> <div class="line-box"><span class="line line-five"></span></div> <div class="line-box"><span class="line line-six"></span></div> </div> <!--输入验证码框给一个绝对定位--> <div class="passInput" id="on"> <input type="text" class="inputCont inputCont-one" maxlength="1" /> <input type="text" class="inputCont inputCont-two" maxlength="1"/> <input type="text" class="inputCont inputCont-three" maxlength="1"/> <input type="text" class="inputCont inputCont-four" maxlength="1"/> <input type="text" class="inputCont inputCont-five" maxlength="1"/> <input type="text" class="inputCont inputCont-six" maxlength="1"/> </div> </div> </div>
第二步:给代码添加样式
.identifying-title{ width: 100%; margin-top: 100px; font-size: 14px; color:#333; text-align: center; } .pass-box{ position: relative; width: 240px; height: 40px; margin: 50px auto 0; } .pass-line{ margin:0 auto; width:100%; height:100%; } .line-box{ float: left; width: 40px; height: 40px; } .line{ display: block; width: 25px; height:3px; margin:18px auto 0; background: #000; } .passInput{ position: absolute; width:240px; height:40px; left: 0; top: 0; } .inputCont{ float: left; width: 25px; height:40px; margin:0 7.5px; z-index: 2; font-size:30px; color:#333; line-height: 40px; text-align: center; background: none; }
第三步:编写js代码
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-2.1.4.min.js">以上所述是小编给大家介绍的JavaScript实现横线提示输入验证码随输入验证码输入消失的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
标签:
js,横线提示输入验证码
明霞山资源网 Design By www.htccd.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
明霞山资源网 Design By www.htccd.com
暂无评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。