CSS3制作分步注册表单
这个DEMO是使用CSS3制作的一个分步注册表单,每个input对应的是每一步,在表单得到焦点时,对应的step也会进行对应的改变。不过这个效果是使用js代码来实现,但整个表单的外观是由CSS3来完成的,整个案例中使用了:@font-face来制作icon图标,使用gradient来制作渐变的按钮效果,使用text-shadow来制作文字阴影效果等等,方便简单点,但细节与创意才是最重要的,喜欢的同学可以看看是怎么实现的吧
1. [文件] index.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>CSS3制作分步注册表单|w3cplus</title>
<meta name="keywords" content="css3学习,css3属性详解,css3 transition,如何学好css3">
<meta name="description" content="W3CPLUS是一个前端爱好者的家园,W3CPLUS努力打造最优秀的web 前端学习的站点。W3CPLUS力求原创,以一起学习,一起进步,共同分享为原则。W3CPLUS站提供了有关于css,css3,html,html5,jQuery,手机移动端的技术文档、DEMO、资源,与前端爱好者一起共勉。">
<link rel="shortcut icon" href="http://www.w3cplus.com/sites/all/themes/marvin/favicon.ico">
<link rel="stylesheet" type="text/css" href="http://www.w3cplus.com/demo/css3/base.css" media="all" />
<style type="text/css" >
body{
background:#1e1f20;
font-size:18px;
}
.login{
width: 330px;
margin: 40px auto 0;
text-align: center;
}
.login h2{
font:italic 32px/40px "Impact";
letter-spacing:1px;
color:rgba(0,0,0,0);
background: -webkit-linear-gradient(top,#ffcf6b,#ffc54c 10%,#ffb320 40%,#c16e05);
background: -moz-linear-gradient(top,#ffcf6b,#ffc54c 10%,#ffb320 40%,#c16e05);
background: linear-gradient(top,#ffcf6b,#ffc54c 10%,#ffb320 40%,#c16e05);
-webkit-background-clip:text;
/*-webkit-text-stroke: 2px #000;*/
}
.login p{
color:#070606;
font-size:28px;
font-style:italic;
font-weight:bold;
text-shadow:1px 1px 0 rgba(255,255,255,.2),-1px -1px 0 rgba(255,255,255,.2);
}
.control-round{
position:relative;
list-style:none;
height:5px;
border:1px solid #222222;
background:#101010;
margin:50px 0 40px;
}
.control-round label{
position:absolute;
top:-18px;
font-family:"Impact";
width:36px;
color:#151515;
line-height:36px;
text-shadow:-1px -1px 1px #666,1px 1px 1px #666;
border-radius:18px;
border:1px solid #686868;
box-shadow:0 0 2px 2px rgba(0,0,0,.2);
background:-webkit-linear-gradient(top,#656565,#393939);
background:-moz-linear-gradient(top,#656565,#393939);
background:linear-gradient(top,#656565,#393939);
}
.control-round label.active{
text-shadow:0 1px 0 #f5b738;
border:1px solid #c4883b;
background:-webkit-linear-gradient(top,#f6ae1b,#b46001);
background:-moz-linear-gradient(top,#f6ae1b,#b46001);
background:linear-gradient(top,#f6ae1b,#b46001);
}
.control-round label.active:after,
.control-round label.active:before{
position:absolute;
display:block;
content:"";
border-style:solid;
left:50%;
top:40px;
}
.control-round label.active:after{
margin:5px 0 0 -6px;
border-width:6px;
border-color:#dc8e0f transparent transparent transparent;
z-index:3;
}
.control-round label.active:before{
margin:4px 0 0 -7px;
border-width:7px;
border-color:#000 transparent transparent transparent;
z-index:2;
}
.control-round label:nth-child(1){
left:0;
}
.control-round label:nth-child(2){
left:50%;
margin-left:-18px;
}
.control-round label:nth-child(3){
right:0;
}
.control-group{
position:relative;
margin:20px 0;
}
.control-group:after{
position:absolute;
display:block;
top:10px;
left:12px;
width:25px;
color:rgba(255,255,255,.6);
text-align:center;
font-size:16px;
content: "\21";
font-family: 'icomoon';
font-style: normal;
speak: none;
font-weight: normal;
-webkit-font-smoothing: antialiased;
}
.control-group:nth-child(2):after{
content: "\22";
}
.control-group input{
padding-left:40px;
width:100%;
height:44px;
border-radius:22px;
border:1px solid #2b2b2b;
box-shadow:inset 0 0 10px rgba(0,0,0,1);
background:#151515;
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}http://www.huiyi8.com/huodong/
.control-group input:focus{
box-shadow: inset 0 1px 3px rgba(255,255,255,0.1), 0 0 8px rgba(255,255,255, 0.6);
}活动总结论文
.form-actions{
text-align:right;
}
.form-actions .btn{
position:relative;
padding:0 20px;
margin-left:5px;
height:35px;
line-height:35px;
color:#000;
text-shadow:0 1px 0 #7f7f7f;
border-radius:17px;
border:1px solid #4f4f4f;
box-shadow:0 0 3px #000;
background:-webkit-linear-gradient(top,#666666,#414141);
background:-moz-linear-gradient(top,#666666,#414141);
background:linear-gradient(top,#666666,#414141);
}
.form-actions .btn:hover{
background:-webkit-linear-gradient(top,#757575,#4e4e4e);
background:-moz-linear-gradient(top,#757575,#4e4e4e);
background:linear-gradient(top,#757575,#4e4e4e);
}
.form-actions .btn:active{
top:1px;
border:1px solid #111;
box-shadow:0 1px 1px #111 inset;
background:-webkit-linear-gradient(top,#4e4e4e,#4e4e4e);
background:-moz-linear-gradient(top,#4e4e4e,#4e4e4e);
background:linear-gradient(top,#4e4e4e,#4e4e4e);
}
.form-actions .btn[type=submit]{
border:1px solid #c36e0e;
text-shadow:0 1px 0 #f4a922;
background:-webkit-linear-gradient(top,#f6ab15,#b46001);
background:-moz-linear-gradient(top,#f6ab15,#b46001);
background:linear-gradient(top,#f6ab15,#b46001);
}
.form-actions .btn[type=submit]:hover{
background:-webkit-linear-gradient(top,#ffc145,#c26905);
background:-moz-linear-gradient(top,#ffc145,#c26905);
background:linear-gradient(top,#ffc145,#c26905);
}
.form-actions .btn[type=submit]:active{
border:1px solid #492700;
box-shadow:0 1px 2px #492700 inset;
background:-webkit-linear-gradient(top,#c16e05,#c16e05);
background:-moz-linear-gradient(top,#c16e05,#c16e05);
background:linear-gradient(top,#c16e05,#c16e05);
}
@font-face {
font-family: 'icomoon';
src:url('fonts/icomoon.eot');
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.svg#icomoon') format('svg'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oForm=document.getElementById('form-control');
var aLabel=oForm.getElementsByTagName('label');
var aInput=oForm.getElementsByTagName('input')
for(var i=0;i<aLabel.length;i++){
aInput[i].index=i;
aLabel[i].onclick=function(){
for(var i=0;i<aLabel.length;i++){
aLabel[i].className='';
}
this.className='active';
}
aInput[i].onclick=function(){
for(var i=0;i<aLabel.length;i++){
aLabel[i].className='';
}
aLabel[this.index].className='active';
}
}
}
</script>
</head>
<body>
<div class="wrap_top_nav">
<nav id="top_nav">
<ul class="inline-style clearfix">
<li><a href="http://www.w3cplus.com" target="_blank">w3cplus</a></li>
<li><a href="http://www.w3cplus.com/resources/css3-tutorial-and-case" target="_blank">css3详解教程</a></li>
<li><a href="http://www.w3cplus.com/demos/list.html" target="_blank">css3实例</a></li>
<li><a href="http://www.w3cplus.com/demo/tags/242.html" target="_blank">藤藤每日一练</a></li>
</ul>
<a id="read" href="http://www.w3cplus.com/demo/sign-up-form.html" target="_blank">查看原文>></a>
</nav>
</div>
<div class="page">
<header id="header">
<hgrounp class="white">
<h1>CSS3制作分步注册表单</h1>
<h2>作者:藤藤(如有更好建议或疑问请加群:1041263)<h2>
</hgrounp>
</header>
<section class="demo">
<div class="login" class="clearfix">
<h2>Sign Up Form</h2>
<p>with steps</p>
<form method="post" action="" id="form-control" >
<div class="control-round" id="control-round">
<label for="email" class="active">1</label>
<label for="password">2</label>
<label for="vpassword">3</label>
</div>
<div class="control-group">
<input type="text" name="loginName" id="email" placeholder="Email Address">
</div>
<div class="control-group">
<input type="text" name="loginName" id="password" placeholder="Password">
</div>
<div class="control-group">
<input type="text" name="loginName" id="vpassword" placeholder="Verify Password">
</div>
<div class="form-actions">
<button class="btn" type="submit" >Sign Up</button>
<button class="btn" type="button" >Clear</button>
</div>
</form>
</div>
</section>
</div>
</body>
</html>
CSS3制作分步注册表单的更多相关文章
- 免费 PSD 下载: 20个精美的登录和注册表单
注册表单有许多不同的形状和尺寸,有的只是单个的输入框,有的则需要多个步骤.登录表单的设计将定义网站的性质,因此它应进行针对性的设计.下面的列表提供了20个醒目的登录和注册表单设计为您提供灵感. 您可能 ...
- Html注册表单示例
注册表单示例,出自<网页开发手记:Html,CSS,JavaScript实战详解>. <html> <head> <title>注册表单&l ...
- 如何利用WordPress创建自定义注册表单插件
来源:http://www.ido321.com/1031.html 原文:Creating a Custom WordPress Registration Form Plugin 译文:创建一个定制 ...
- HTML6注册表单输入日志标题
一.找到元素. var d = document.getElementById("") var d = document.getElementsByName("" ...
- 很酷的CSS3仿Facebook登录表单
原文:很酷的CSS3仿Facebook登录表单 今天看到一款很不错的CSS3登录表单,外观是仿Facebook的登录表单,还挺不错的,另外也支持简单的表单输入框验证.下图是表单的效果图: 我们也可以在 ...
- form注册表单圆角 demo
form注册表单圆角 <BODY> <div class="form"> <ul class="list"> <li& ...
- 模拟js中注册表单验证
示例1 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...
- UX设计秘诀之注册表单设计,细节决定成败
以下内容由摹客团队翻译整理,仅供学习交流,摹客iDoc是支持智能标注和切图的产品协作设计神器. 说实话,现实生活中,又有多少人会真正喜欢填写表格?显然,并不多.因为填写表单这样的网页或App服务,并非 ...
- 基于HTML5手机登录注册表单代码
分享一款基于HTML5手机登录注册表单代码.这是一款鼠标点击注册登录按钮弹出表单,适合移动端使用.效果图如下: 在线预览 源码下载 实现的代码. html代码: <div class=&qu ...
随机推荐
- css写箭头
/* 向上的箭头 */ .dot-top { font-size: 0; line-height: 0; border-width: 10px; border-color: red; border-t ...
- centos关机与重启命令详解
Linux centos关机与重启命令详解与实战 Linux centos重启命令: 1.reboot 普通重启 2.shutdown -r now 立刻重启(root用户使用) 3.shutdo ...
- CentOS下使用yum快速安装memcached
1. 查找Memcached yum search memcached 首先检查yum软件仓库中是否存在memcached,如果有 直接进入第3步安装即可,否则执行第2步. 2. 安装第三方软件库(可 ...
- linux系统寻找僵尸进程
1. 用top命令来查看服务器当前是否有僵尸进程. 2. 用ps和grep命令寻找僵尸进程 $ ps -A -ostat, pid, ppid, cmd | grep -e '^[Zz]' 命令解释: ...
- Linux 安装json神器 jq
wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 chmod +x ./jq cp jq /u ...
- 实战c++中的vector系列--creating vector of local structure、vector of structs initialization
之前一直没有使用过vector<struct>,如今就写一个简短的代码: #include <vector> #include <iostream> int mai ...
- android 二维码制作,显示到UI,并保存SD卡,拿来就能用!!
转载请注明出处:王亟亟的大牛之路 如今二维码已经渗透了我们的生活.各种扫码关注啊.扫码下载的,今天上一个依据输入内容生成二维码的功能. 包结构: 界面截图: 功能:输入网址–>生成图片–> ...
- unity shader 编辑器扩展类 ShaderGUI
这应该unity5才出的新功能了,今天看文档时刚巧看到了,就来尝试了一下. 效果如图: shader 的编辑器扩展分为2种方法: 是通过UnityEditor下的ShaderGUI类来实现的,形式比较 ...
- Elasticsearch集群问题,导致主master节点发现不了node节点
个人博客:https://blog.sharedata.info/ 最新需要配置es集群采用5个分片和1个副片,正好是11台机器,而只保留一份备份所以只需要5*2=10台机器方案:1.1台作为mast ...
- 洛谷P1038 神经网络==codevs1088 神经网络
P1038 神经网络 题目背景 人工神经网络(Artificial Neural Network)是一种新兴的具有自我学习能力的计算系统,在模式识别.函数逼近及贷款风险评估等诸多领域有广泛的应用.对神 ...