css3实现一款模仿iphone样式的注册表单


Posted in HTML / CSS onMarch 20, 2013

效果图如下:
css3实现一款模仿iphone样式的注册表单
代码:

<!DOCTYPE html>
<html lang="">
<head>
<title>Animated Checkboxes using CSS3</title>
<meta charset="utf-8">
<meta name="description" content="UI checkboxes using CSS3" />
<meta name="keywords" content="CSS3, checkboxes" />
<meta name="robots" content="" />
<style type="text/css">
html, body, h1, form, fieldset, legend, ol, li {
margin: 0;
padding: 0;
}
body {
background: #ffffff;
color: #111111;
font-family: Helvetica;
padding: 20px;
font-size: 12px
}
input:not([type=checkbox]), textarea {
width: 250px;
padding: 5px;
border: 1px solid #ccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
form {
width: 500px;
margin: 0 auto 0 auto;
}
form fieldset {
padding: 26px;
border: 1px solid #b4b4b4;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
form legend {
padding: 5px 20px 5px 20px;
color: #030303;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border: 1px solid #b4b4b4;
}
form ol {
list-style: none;
margin-bottom: 20px;
border: 1px solid #b4b4b4;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
padding: 10px;
}
form ol, form legend, form fieldset {
background-image: -moz-linear-gradient(top, #f7f7f7, #e5e5e5); /* FF3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #e5e5e5),color-stop(1, #f7f7f7)); /* Saf4+, Chrome */
}
form ol.buttons {
overflow: auto;
}
form ol li label {
float: left;
width: 160px;
font-weight: bold;
}
/*
form ol.radio-buttons li {
float:left;
margin-bottom:0;
width:8px;
}
form ol.radio-buttons li label {
line-height:20px;
padding-right:20px;
width:80px;
}
form ol.radio-buttons li input {
padding:0;
width:20px;
}
*/
.settings {
/* width: 400px; */
list-style: none;
position: relative;
}
.settings p {
display: block;
margin-bottom: 20px;
background: -moz-linear-gradient(50% 50% 180deg,#C91A1A, #DB2E2E, #0C990C 0%);
background: -webkit-gradient(linear, 50% 50%, 0% 50%, from(#C90202), to(#009C05), color-stop(0,#00AB00));
border-radius: 8px;
-moz-border-radius: 6px;
border: 1px solid #555555;
width: 36px;
position: relative;
height: 15px;
}
/*
.settings p:before {
content: "ON";
padding-left: 9px;
line-height: 15px;
color: #fff;
font-size: 14px;
text-shadow: #093B5C 0px -1px 1px;
}
.settings p:after {
content: "OFF";
padding-left: 12px;
line-height: 15px;
color: #fff;
font-size: 14px;
text-shadow: #093B5C 0px -1px 1px;
}
*/
.check {
display: block;
width: 20px;
height: 13px;
border-radius: 8px;
-moz-border-radius: 6px;
background: -moz-linear-gradient(19% 75% 90deg,#FFFFFF, #A1A1A1);
background: #fff -webkit-gradient(linear, 0% 0%, 0% 100%, from(#A1A1A1), to(#FFFFFF));
border: 1px solid #e5e5e5;
position: absolute;
top: 0px;
left: 0px;
}
input[type=checkbox] {
display: none;
}
@-webkit-keyframes labelON {
0% {
top: 0px;
left: 0px;
}
100% {
top: 0px;
left: 14px;
}
}
input[type=checkbox]:checked + label.check {
top: 0px;
left: 14px;
-webkit-animation-name: labelON;
-webkit-animation-duration: .2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: ease-in;
-webkit-box-shadow: #244766 -1px 0px 3px;
-moz-box-shadow: #244766 -1px 0px 3px;
}
@-webkit-keyframes labelOFF {
0% {
top: 0px;
left: 16px;
}
100% {
top: 0px;
left: 0px;
}
}
input[type=checkbox] + label.check {
top: 0px;
left: 0px;
-webkit-animation-name: labelOFF;
-webkit-animation-duration: .2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: ease-in;
-webkit-box-shadow: #244766 1px 0px 3px;
-moz-box-shadow: #244766 1px 0px 3px;
}
label.info {
position: absolute;
color: #000;
top:0px;
left: 50px;
line-height: 15px;
width: 200px;
}
form ol.buttons li {
float: left;
width: 100px;
}
input[type=submit] {
width: 80px;
color: #f3f3f3;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-image: -moz-linear-gradient(top, #0cb114, #07580b); /* FF3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #07580b),color-stop(1, #0cb114)); /* Saf4+, Chrome */
-webkit-box-shadow: #4b4b4b 0px 2px 5px;
-moz-box-shadow: #4e4e4e 0px 2px 5px;
box-shadow: #e3e3e3 0px 2px 5px;
border: none;
}
input[type=reset] {
width: 80px;
color: #f3f3f3;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-image: -moz-linear-gradient(top, #d01111, #7e0c0c); /* FF3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #7e0c0c),color-stop(1, #d01111)); /* Saf4+, Chrome */
-webkit-box-shadow: #4b4b4b 0px 2px 5px;
-moz-box-shadow: #4e4e4e 0px 2px 5px;
box-shadow: #e3e3e3 0px 2px 5px;
border: none;
}
input[type=file] {
width: 80px;
}
</style>
</head>
<body>
<form id="form-1" action="" method="post">
<fieldset>
<legend><b>请填写您的信息</b></legend>
<ol>
<li><label for="field1">个人账号:</label></li>
<li><input type="text" id="field1" name="field1" required/></li>
</ol>
<ol>
<li><label for="field2">个人密码:</label></li>
<li><input type="password" id="field2" name="field2" /></li>
</ol>
<div class="settings">
<p>
<input type="checkbox" value="1" id="1" name="1" checked="checked"/>
<label class="check" for="1"></label>
<label class="info">允许被转载</label>
</p>
<p>
<input type="checkbox" value="2" id="2" name="2" />
<label class="check" for="2"></label>
<label class="info">允许被评论</label>
</p>
</div>
<ol class="buttons">
<li><input type="submit" class="button" value="提交" /></li>
<li><input type="reset" class="button" value="重置" /></li>
</ol>
</fieldset>
</form>
</body>
</html>

 

HTML / CSS 相关文章推荐
纯CSS3实现Material Design效果
Mar 09 HTML / CSS
CSS3实现超慢速移动动画效果非常流畅无卡顿
Jun 15 HTML / CSS
CSS3媒体查询Media Queries基础学习教程
Feb 29 HTML / CSS
详解CSS3的opacity属性设置透明效果的用法
May 09 HTML / CSS
CSS3实现10种Loading效果
Jul 11 HTML / CSS
CSS3之transition实现下划线的示例代码
May 30 HTML / CSS
简单介绍HTML5中的文件导入
May 08 HTML / CSS
HTML5地理定位_动力节点Java学院整理
Jul 12 HTML / CSS
HTML5 LocalStorage 本地存储详细概括(多图)
Aug 18 HTML / CSS
HTML5 3D旋转相册的实现示例
Dec 03 HTML / CSS
详解Html5项目适配系统深色模式方案总结
Apr 14 HTML / CSS
css height属性中的calc方法详解
Jun 03 HTML / CSS
css3打造一款漂亮的卡哇伊按钮
Mar 20 #HTML / CSS
css3.0 图形构成实例练习二
Mar 19 #HTML / CSS
css3.0 图形构成实例练习一
Mar 19 #HTML / CSS
基于css3实现漂亮便签样式
Mar 18 #HTML / CSS
css3 按钮 利用css3实现超酷下载按钮
Mar 18 #HTML / CSS
利用css3制作3D样式按钮实现代码
Mar 18 #HTML / CSS
css3 按钮样式简单可扩展创建
Mar 18 #HTML / CSS
You might like
IIS6的PHP最佳配置方法
2007/03/19 PHP
PHP中func_get_args(),func_get_arg(),func_num_args()的区别
2013/09/30 PHP
php表单敏感字符过滤类
2014/12/08 PHP
php workerman定时任务的实现代码
2018/12/23 PHP
PHP正则表达式函数preg_replace用法实例分析
2020/06/04 PHP
JavaScript 事件的一些重要说明
2009/10/25 Javascript
js字符串截取函数substr substring slice使用对比
2013/11/27 Javascript
JavaScript结合AJAX_stream实现流式显示
2015/01/08 Javascript
JavaScript编写推箱子游戏
2015/07/07 Javascript
jQuery实现文件上传进度条特效
2015/08/12 Javascript
jQuery实现瀑布流布局详解(PC和移动端)
2020/09/01 Javascript
jQuery文字横向滚动效果的实现代码
2016/05/31 Javascript
easyUI下拉列表点击事件使用方法
2017/05/18 Javascript
vue实现模态框的通用写法推荐
2018/02/26 Javascript
微信小程序自定义组件封装及父子间组件传值的方法
2018/08/28 Javascript
jQuery easyui datagird编辑行删除行功能的实现代码
2018/09/20 jQuery
教你如何编写Vue.js的单元测试的方法
2018/10/17 Javascript
使用JavaScript保存文本文件到本地的两种方法
2019/01/22 Javascript
移动端JS实现拖拽两种方法解析
2020/10/12 Javascript
8个非常实用的Vue自定义指令
2020/12/15 Vue.js
python中sys.argv参数用法实例分析
2015/05/20 Python
Python+matplotlib+numpy实现在不同平面的二维条形图
2018/01/02 Python
微信小程序python用户认证的实现
2019/07/29 Python
python ImageDraw类实现几何图形的绘制与文字的绘制
2020/02/26 Python
在pycharm中文件取消用 pytest模式打开的操作
2020/09/01 Python
pycharm激活方法到2099年(激活流程)
2020/09/22 Python
opencv实现图像几何变换
2021/03/24 Python
大学生期末自我鉴定
2014/02/01 职场文书
常务副总经理岗位职责
2014/04/12 职场文书
迎新春趣味活动方案
2014/08/24 职场文书
2014年环保工作总结
2014/11/26 职场文书
公司门卫岗位职责
2015/04/13 职场文书
开学第一周值周总结
2015/07/16 职场文书
那些美到让人窒息的诗句,值得你收藏!
2019/08/20 职场文书
Python基础之Socket通信原理
2021/04/22 Python
Java Redisson多策略注解限流
2022/09/23 Java/Android