bootstrap 一个简单的登陆页面
效果如图:用bootstrap 写的一个简单的登陆
一、修改样式
样式可以自己调整,例如换个背景色之类的,修改 background-color属性就可以
#from{background-color: #96b97d;}
我自己调的时候只给from加了背景色,当然可以给整个页面加背景色,设置body背景色就可以
body{background-color: #96b97d;}
当然也可以设置背景图片之类的
body {background:url(../img/login_bg_0.jpg) #f8f6e9;}
至于效果,可以自己去试验。
二、废话少说,上完整代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><meta charset="utf-8" /><title>用户登录</title><link rel="stylesheet" href="css/style.css" /><script src="js/bootstrap.min.js"></script><link href="../css/bootstrap.css" rel="stylesheet" type="text/css" /><script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script><style>#from{background-color: #96b97d;}.mycenter{margin-top: 100px;margin-left: auto;margin-right: auto;height: 350px;width: 500px;padding: 5%;padding-left: 5%;padding-right: 5%;}.mycenter mysign{width: 440px;}.mycenter input, checkbox, button{margin-top: 2%;margin-left: 10%;margin-right: 10%;}.mycheckbox{margin-top: 10px;margin-left: 40px;margin-bottom: 10px;height: 10px;}</style><script type="text/javascript">$(function () {$('#btn').click(function (e) {window.location.href = "main.aspx";});});</script></head><body><form id="from"><div class="mycenter"><div class="mysign"><div class="col-lg-11 text-center text-info"><h2>请登录</h2></div><div class="col-lg-10"><input type="text" class="form-control" name="useame" placeholder="请输入账户名" requiredautofocus /></div><div class="col-lg-10"></div><div class="col-lg-10"><input type="password" class="form-control" name="password" placeholder="请输入密码" requiredautofocus /></div><div class="col-lg-10"></div><div class="col-lg-10 mycheckbox checkbox"><input type="checkbox" class="col-lg-1">记住密码</input></div><div class="col-lg-10"></div><div class="col-lg-10"><button type="button" id="btn" class="btn btn-success col-lg-12">登录</button></div></div></div></form></body></html>
作者:高空燕子飞过
来源链接:https://www.cnblogs.com/zhangjd/p/8438423.html
版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。
2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。