潭州课堂25班:Ph201805201 WEB 之 页面编写 第四课 登录注册 (课堂笔记)
index.html 首页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <!--引入本地--> <link rel="stylesheet" href="css/common.css"> <!--引入本地--> <link rel="stylesheet" href="css/index.css"> <!--引入本地--> <link rel="stylesheet" href="css/login.css"> <!--引入本地--> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_z2ywx2u4woc.css"> <!--引入阿里图标--> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <!--引入 JQ--> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="#">首页</a> </li> <li><a href="course.html">在线课堂</a> </li> <li><a href="pay.html">付费课程</a> </li> <li><a href="search.html">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="reg.html">注册</a> </span> <span><a href="login.html">登录</a> </span> </div> </div> </div> <!--header end--> <!--main star--> <div class="main"> <div class="main-box clearfix"> <div class="main-contain"> <!--banner--> <div class="banner"> <ul class="pic"> <li><img class="show" src="https://res.shiguangkey.com//file/201806/19/20180619142252602590185.jpg"></li> <li><img src="https://res.shiguangkey.com//file/201806/19/20180619141337485823895.jpg"></li> <li><img src="https://res.shiguangkey.com//file/201806/21/20180621150342030454625.jpg"></li> <li><img src="https://res.shiguangkey.com//file/201805/17/20180517113424433990524.jpg"></li> </ul> <ul class="tab"> <li class="on"></li> <li></li> <li></li> <li></li> </ul> <ul class="btn"> <li class="left"><</li> <li class="right">></li> </ul> </div> <div class="contain"> <ul class="recommend-news"> <li> <a href="#"><img src="https://res.shiguangkey.com//file/201806/04/20180604235838752491899.png!mall_course_a" alt="test"></a> <p> <a href="#">SEO优化,最新快速排名技巧解答分享</a> </p> </li> <li> <a href="#"><img src="https://res.shiguangkey.com//file/201805/26/20180526105323340886406.png!" alt="test"></a> <p> <a href="#">web前端零基础入门</a> </p> </li> <li> <a href="#"><img src="https://res.shiguangkey.com//file/201805/03/20180503165311843004082.png!" alt="test"></a> <p> <a href="#">韩语小白变大神</a> </p> </li> </ul> </div> <!--news nav--> <div class="news-nav"> <ul class="nav"> <li class="active">python</li> <li>前端</li> <li>爬虫</li> <li>网络安防</li> </ul> <ul class="contain"> <li class="show"> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201805/03/20180503165311843004082.png!mall_course_a" alt=""> </div> <div class="right"> <p><span>可里:</span>大学韩国语专业 亚篮锦标赛韩语随同翻译 3年线上韩语教育经验</p> <p><span>小美:</span>大学韩语专业 韩语TOPIK6级 三年线上教学经验</p> <p><span>鸭梨:</span>大学韩国语专业 2年线上韩语教学经验 多年韩国漫画翻译经验</p> <p><span>可可:</span>韩语随同翻译 牙科医疗反映 丰富口译经验 多年爱豆站姐翻译经验</p> </div> </div> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201807/23/20180723165649433839624.png!mall_course_a"> </div> <div class="right"> <p><span>Kayee:</span>口语水平优秀 语言表达能力强 教学经验丰富 对学员有耐心</p> <p><span>Celin:</span>课堂活泼有趣 注重和学员互动 轻轻松松帮大家理解英语知识</p> <p><span>Molly:</span>商务英语专业 对学员耐心 喜欢发掘不同类型的英语应用</p> <p><span>Zoey:</span>口语水平优秀 语言表达能力强 注重培养学员的口语能力和书写能力</p> </div> </div> </li> <li> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201805/26/20180526105323340886406.png!mall_course_a" alt=""> </div> <div class="right"> <p><span>PC+移动开发班</span></p> <p>html + css</p> <p><span>移动网站开发内容</span></p> <p>html5 + css3</p> </div> </div> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201804/11/20180411113302019932295.jpg!mall_course_a"> </div> <div class="right"> <p><span>javascript</span></p> <p>操作DOM 面向对象 Jquery ECMAScript6</p> <p><span>前端框架</span></p> <p>vue Angular React</p> </div> </div> </li> <li> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201807/02/20180702141502580115367.png!mall_course_a" alt=""> </div> <div class="right"> <p><span>基础阶段</span></p> <p>python基础 python进阶 web前端</p> <p><span>实战阶段</span></p> <p>框架 项目</p> </div> </div> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201807/02/20180702153723740596415.png!mall_course_a"> </div> <div class="right"> <p><span>Python数据分析与机器学习</span></p> <p>numpy pandas matplotlib seaborn</p> <p>K邻近算法 线性回归与逻辑回归算法</p> <p>决策树算法 集成算法与随机森林 贝叶斯算法 支持向量机</p> </div> </div> </li> <li> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201804/19/20180419103002769224662.jpg!mall_course_a" alt=""> </div> <div class="right"> <p><span>c++课程体系</span></p> <p>C语言核心 C++语言核心</p> <p>Windows核心编程 Linux核心编程</p> <p>QT核心编程 服务器核心编程</p> </div> </div> <div class="clearfix"> <div class="left"> <img src="https://res.shiguangkey.com//file/201807/02/20180702153645933550456.png!mall_course_a"> </div> <div class="right"> <p><span>罗伯特:</span>十年项目开发经验 精通C/C++、Windows游戏编程</p> <p><span>九夏老师:</span>七年企业级项目实战经验,擅长Windows/Linux平台</p> <p><span>Danny:</span>八年大型项目开发经验,精通C/C++编程语言,擅长WindowsAPI</p> <p><span>强森老师:</span>五年企业级IT项目开发经验,三年线下教学经验</p> </div> </div> </li> </ul> </div> <div class="more">加载更多</div> </div> <div class="aside"> <div class="side-activities"> <h2>公开课<span>更多</span></h2> <div> <img src="https://res.shiguangkey.com/file/201804/19/20180419161303876645368.png!mall_course_b"> <p>python零基础入门到项目实战</p> <hr> </div> <div> <h2>VIP课<span>更多</span></h2> <div> <img src="https://res.shiguangkey.com//file/201804/19/20180419103636100353500.jpg!mall_course_a" alt=""> <p>Python基础</p> <p>Python进阶</p> <p>Python web</p> <p>框架(Django Tornado)</p> <p>项目实战</p> <hr> </div> <div class="about" style="background: url(2.png)no-repeat 200px 10px/120px 150px"> <h4>关注我</h4> <ul> <li><i class="iconfont icon-ai-weixin" style="color: blue"></i>gdwz922</li> <li><i class="iconfont icon-QQ"style="color: blue"></i>i649975652</li> <li><i class="iconfont icon-weibo"style="color: blue">....</i></li> </ul> </div> </div> </div> </div> </div> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> <script src="js/index.js"></script> </body> </html>
course.html 在线课程
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/common.css"> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_yqg5z4kxenj.css"> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="index.html">首页</a> </li> <li><a href="#">在线课堂</a> </li> <li><a href="pay.html">付费课程</a> </li> <li><a href="search.html">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="reg.html">注册</a> </span> <span><a href="login.html">登录</a> </span> </div> </div> </div> <!--header end--> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> </body> </html>
pay.html 付款课程
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/common.css"> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_yqg5z4kxenj.css"> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="index.html">首页</a> </li> <li><a href="course.html">在线课堂</a> </li> <li><a href="#">付费课程</a> </li> <li><a href="search.html">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="reg.html">注册</a> </span> <span><a href="login.html">登录</a> </span> </div> </div> </div> <!--header end--> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> </body> </html>
reg.html 注册
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/common.css"> <link rel="stylesheet" href="css/index.css"> <link rel="stylesheet" href="css/reg.css"> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_z2ywx2u4woc.css"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="index.html">首页</a> </li> <li><a href="course.html">在线课堂</a> </li> <li><a href="pay.html">付费课程</a> </li> <li><a href="search.html">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="#">注册</a> </span> <span><a href="login.html">登录</a> </span> </div> </div> </div> <!--header end--> <div class="contain"> <div class="reg-contain"> <div class="reg-top"> <h2>请注册</h2> <a href="reg.html" class="regist">登录></a> </div> <form action=""> <div><input type="text" placeholder="请输入手机号"></div> <div> <input class="form-captcha" type="text" placeholder="请输入短信验证码"> <a class="captcha-btn" href="#">发送验证码</a> </div> <div><input type="text" placeholder="请输入用户名"></div> <div><input type="password" placeholder="请输入密码"></div> <div><input type="password" placeholder="请输入再次密码"></div> <div> <input class="captcha-graph" type="text" placeholder="请输入图形验证码"> <a class="captcha-image"href="#">发图形证码</a> </div> <div><input type="submit" value="注册"></div> </form> </div> </div> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> <script src="js/index.js"></script> <script> $(function(){ // alert('你妹'); //判断 jq 是否引入成功 var $btn = $('.captcha-btn'); var x = 5; //时间秒 var timer; $btn.click(function(){ timer = setInterval(function(){ $btn.html(x+'s'); x--; if(x < 0){ clearInterval(timer); $btn.html('重新发送'); } },1000) }) }) </script> </body> </html>
login.html 登录
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/common.css"> <link rel="stylesheet" href="css/index.css"> <link rel="stylesheet" href="css/login.css"> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_z2ywx2u4woc.css"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="index.html">首页</a> </li> <li><a href="course.html">在线课堂</a> </li> <li><a href="pay.html">付费课程</a> </li> <li><a href="search.html">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="reg.html">注册</a> </span> <span><a href="#">登录</a> </span> </div> </div> </div> <!--header end--> <div class="contain"> <div class="login-contain"> <div class="login-top"> <h2>请登录</h2> <a href="reg.html" class="regist">立即注册></a> </div> <form action=""> <div><input type="text" placeholder="请输入用户名"></div> <div><input type="password" placeholder="请输入密码"></div> <div><label><input type="checkbox">七天内免登录</label> <!--<label> 是关联标签--> <a href="#">忘记密码</a> </div> <div><input type="submit" value="登录"></div> </form> </div> </div> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> <script src="js/index.js"></script> </body>
search.html 搜索
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/common.css"> <link rel="stylesheet" href="https://at.alicdn.com/t/font_791183_yqg5z4kxenj.css"> </head> <body> <!--header star--> <div class="header"> <div class="header-contain"> <h1 class="log"><a href="#" class="logo-title"></a></h1> <ul class="menu"> <li><a href="index.html">首页</a> </li> <li><a href="course.html">在线课堂</a> </li> <li><a href="pay.html">付费课程</a> </li> <li><a href="#">搜索</a> </li> </ul> <div class="log-box"> <i class="iconfont icon-iconuser"></i> <!--引入图标时一般用 i 标签 --> <span><a href="reg.html">注册</a> </span> <span><a href="login.html">登录</a> </span> </div> </div> </div> <!--header end--> <!--footer star--> <div class="footer"> <div class="footer-box"> <div class="footer-content"> <p> <span><a href="#">关于 python</a> </span> <span><a href="#">python 开发</a> </span> <span><a href="#">python 数据分析</a> </span> <span><a href="#">python 关于我:<i class="iconfont icon-ai-weixin" ></i></a> </span> </p> <p> <span><a href="#">地址:福建.........</a> </span> <span><a href="#">联系电话:12345678911</a> </span> </p> </div> <p class="bottom-content">Copyright © 2015 - 2018 潭州python学院. All Rights Reserved</p> </div> </div> </body> </html>
css 文件
common.css 共同样式
.header{ height: 69px; width: 100%; background: black; color: white; } .header .header-contain{ width: 1200px; height: 69px; line-height: 69px; margin: auto; background: blue; } /*logo star*/ .header .header-contain .log{ width: 230px; height: 64px; float: left; /*左浮动*/ } .header .header-contain .log .logo-title{ display: block; /*块级*/ width: 100%; height: 100%; background: url("https://www.python.org/static/img/python-logo.png ") no-repeat ;/*不平铺*/ } /*logo end*/ /*meau star*/ .header .header-contain .meau{ float: left; margin-left: 100px; } .header .header-contain .menu li{ height: 69px; padding: 0 30px; float: left; /*border-bottom: 5px solid red;*/ /*box-sizing:border-box;*/ } .header .header-contain .menu li.active{ border-bottom: 5px solid red; box-sizing: border-box; } .header .header-contain .menu li:hover{ border-bottom: 5px solid red; box-sizing: border-box; } /*meau end*/ .header .header-contain .log-box { float: right; } .header .header-contain .log-box i{ /*阿里云图标*/ font-size: 30px; vertical-align: -4px; /*对齐方式*/ } /*footer star*/ .footer{ width: 100%; background: blueviolet; } .footer .footer-box{ margin: auto; text-align:center; /*文字水平居中*/ color: white; } .footer .footer-box .footer-content{ line-height: 50px; padding: 20px 0; background: url("https://www.python.org/static/img/python-logo.png ") no-repeat 50px 20px;/*不平铺*/ } .footer .footer-box .bottom-content{ line-height: 50px; width: 100%; background: black; }
index.css
.main{ width: 100%; /*background: red;*/ padding: 30px 0; } .main .main-box{ width: 1200px; /*height: 1000px;*/ margin: auto; /*居中*/ /*background: yellowgreen;*/ } .main .main-box .main-contain{ float: left; /*左浮动*/ width: 800px; } .main .main-box .main-contain .banner{ width: 800px; height: 200px; position: relative; /*background: blue;*/ } .main .main-box .main-contain .banner .pic li img{ width: 800px; height: 200px; position: absolute; left: 0; top: 0; } .main .main-box .main-contain .banner .pic li img{ display: none; } .main .main-box .main-contain .banner .pic li .show{ display: block; } .main .main-box .main-contain .banner .tab{ position: absolute; left: 340px; bottom: 15px; } .main .main-box .main-contain .banner .tab li{ height: 20px; width: 20px; border: 1px solid white; float: left; margin: 10px; border-radius: 50%; /*方变圆*/ cursor: pointer; /*出现小手*/ } .main .main-box .main-contain .banner .tab .on{ background: red; } .main .main-box .main-contain .banner .btn{ font-size: 50px; color: white; font-weight: bold; line-height: 200px; cursor: pointer; /*出现小手*/ display: none; } .main .main-box .main-contain .banner:hover .btn{ display: block; } .main .main-box .main-contain .banner .btn .left{ position: absolute; left: 5px; } .main .main-box .main-contain .banner .btn .right{ position: absolute; right: 5px; } .main .main-box .main-contain .contain{ width: 800px; /*background: red;*/ font-size: 14px; } .main .main-box .main-contain .contain .recommend-news li a img{ width: 250px; height: 180px; /*固定图片大小*/ transition: all 1s; /**在放大图片时有时间过度 */ } .main .main-box .main-contain .contain .recommend-news{ display: flex; justify-content:space-between; /*弹性盒模型,大小自动分配 (一步做完浮动)*/ padding: 20px 10px; } .main .main-box .main-contain .contain .recommend-news li p{ text-align: center; /*居中*/ line-height: 25px; /**/ } .main .main-box .main-contain .contain .recommend-news li a img:hover{ transform: scale(1.2); /*鼠标移入时放大多少倍*/ } /*news-nav */ .main .main-box .main-contain .news-nav .nav{ width: 800px; height: 65px; background: yellow; line-height: 60px; /**行高与 height 一样时,文字垂直居中*/ } .main .main-box .main-contain .news-nav .nav li{ float: left; /*浮动*/ margin: 0 20px; } .main .main-box .main-contain .news-nav .nav li.active{ border-bottom: 5px solid red; box-sizing: border-box; /**让上行设置的底边往上移*/ } .main .main-box .main-contain .news-nav .nav li:hover{ cursor: pointer; //**加小手*/ } .main .main-box .main-contain .news-nav .contain{ width: 800px; /*height: 800px;*/ /*background:brown;*/ } .main .main-box .main-contain .news-nav .contain .left img{ float: left; width: 260px; height: 200px; padding: 5px; border-radius: 20px; /*小圆角*/ overflow: hidden; /*超出隐藏*/ margin-right: 10px; transition: all 1s; //*图片慢慢变大*/ } .main .main-box .main-contain .news-nav .contain .left img:hover{ transform: scale(1.2); } .main .main-box .main-contain .news-nav .contain .right{ float: left; line-height: 35px; padding: 26px 0 0 0; font-size: 16px; } .main .main-box .main-contain .news-nav .contain li{ display: none; } .main .main-box .main-contain .news-nav .contain li.show{ display:block; } .main .main-box .main-contain .more{ width: 500px; height: 60px; margin: 10px auto; background: yellow; border-radius: 10px; line-height: 60px; /*垂直居中*/ text-align: center; /*水平居中*/ cursor: pointer; //**加小手*/ } /*aside*/ .main .main-box .aside{ width: 360px; float: right; /*height: 700px;*/ background: yellow; } .main .main-box .aside .side-activities h2{ padding: 0 30px; height: 35px; line-height: 35px; } .main .main-box .aside .side-activities span{ float: right; color: skyblue; cursor: pointer; //**加小手*/ } .main .main-box .aside .side-activities div img{ width: 320px; padding: 0 20px; } .main .main-box .aside .side-activities div p{ padding: 0 30px; height: 30px; line-height: 30px; } .main .main-box .aside .side-activities .about{ padding: 0 20px; width: 320px; background: url('2.png') no-repeat 200px 10px/100px 100px; } .main .main-box .aside .side-activities .about ul li { font-size: 15px; line-height: 50px; } .main .main-box .aside .side-activities .about ul li{ height: 50px; line-height: 50px; font-size: 18px; } .main .main-box .aside .side-activities .about ul li i{ vertical-align: -8px; margin-left: 20px; font-size: 35px; }
login.css
body{ background: yellow; } .contain{ width: 100%; padding-top: 50px;; } .contain .login-contain{ width: 440px; /*height: 500px;*/ margin: auto; padding: 0 20px; background: white; } .contain .login-contain .login-top{ height: 60px; line-height: 60px; border-bottom: 1px solid black; } .contain .login-contain .login-top h2{ float: left; border-bottom: 5px solid red; height: 60px; font-size: 22px; box-sizing: border-box; /*线条往里边缩*/ } .contain .login-contain .login-top .regist{ float: right; font-size: 22px; } form div{ margin-top: 20px; } form div input{ width: 100%; height: 40px; border: 1px solid red; padding-left: 10px; /*框内文字距离左边有点距离*/ font-size: 18px; border-radius: 5px; box-sizing: border-box; /*线条往里边缩*/ } form div label input{ width: 15px; height: 15px; vertical-align: -5px; /*框和文字对齐*/ } form div a{ float: right; } form div input[type=submit]{ /*登录*/ background: skyblue; margin-bottom: 20px; cursor: pointer; /*小手*/ } .footer{ position: fixed; /*固定定位*// left:0; bottom: 0; }
reg.css
body{ background: yellow; } .contain{ width: 100%; padding-top: 50px; } .contain .reg-contain{ width: 440px; padding: 0 20px 30px 20px; background: white; margin: auto; } .contain .reg-contain .reg-top{ height: 60px; line-height: 60px; font-size: 22px; border-bottom: 1px solid black; } .contain .reg-contain .reg-top h2{ float: left; height: 60px; border-bottom: 5px solid blue; box-sizing: border-box; /*线条往里边缩*/ } .contain .reg-contain .reg-top a{ float: right; } form div { margin-top: 20px; height: 40px; width: 440px; } form div input{ width: 100%; height: 40px; border: 1px solid red; padding-left: 10px; /*框内文字距离左边有点距离*/ font-size: 18px; border-radius: 5px; box-sizing: border-box; /*线条往里边缩*/ } form div input.form-captcha,input.captcha-graph{ width: 306px; float: left; } form div a.captcha-btn,a.captcha-image{ float: right; display: block; width: 120px; height: 38px; text-align: center; line-height: 38px; border-radius: 5px; border: 1px solid red; } input[type=submit]{ cursor: pointer; /*小手*/ } .footer{ position: fixed; /*固定定位*// left:0; bottom: 0; }
reset.css 样式重写
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; } a{ text-decoration: none; color: inherit; } /*清除浮动*/ .clearfix::after{ content: ""; display: block; clear: both; /*overflow: hidden; 超出隐藏 清除浮动*/ }
Js文件
/** * Created by Administrator on 2018/8/15 0015. */ $(function(){ var $picli = $('.banner .pic li img'); var $tabli = $('.banner .tab li'); var $btnli = $('.banner .btn li'); var len = $picli.length; //var len1 = $btnli.length; //console.log(len1); var n = 0; // 记录上次变量 var timer; // 初始化 //..... //tab 区域 $tabli.click(function(){ var x = $(this).index() ; //获取点击该按键的下标, if(x != n){ chan(x); //console.log(x); } }); //btn区域 $btnli.click(function(){ var x = n; if($(this).index()){ x++; x %= len; chan(x); } else { x--; if(x<0) x = len-1; chan(x); } }); // 自动 轮播 function auto(){ timer = setInterval(function(){ var x = n; x++; x %= len; chan(x); },3000) } auto(); $('.banner').hover(function () { //鼠标移入清除定时器 clearInterval(timer); },auto); //鼠标移出重启轮播 function chan(i){ $tabli.eq(n).removeClass('on'); // 点哪个,给哪个按键删除 class $picli.eq(n).fadeOut(2000); n = i; $tabli.eq(n).addClass('on'); // 点哪个,给哪个按键加 class $picli.eq(n).fadeIn(2000); // } }); $(function(){ var $nav = $('.main .main-box .main-contain .news-nav .nav li'); var $contain = $('.main .main-box .main-contain .news-nav .contain li'); var n=0; var len1 = $nav.length; var len = $contain.length; console.log(len,len1); $nav.click(function(){ var x = $(this).index(); $nav.eq(n).removeClass('active'); $contain.eq(n).removeClass('show'); n = x; $nav.eq(n).addClass('active'); $contain.eq(n).addClass('show'); }) });