表单/表格

基于Bootstrap的简洁登录界面设计效果

阿里云


这是一款基于 Bootstrap 的简洁登录界面设计效果。该登录界面利用 bootstrap 的网格和表单元素来进行布局,简单美观,非常实用。

使用方法

在页面中引入 bootstrap 的相关文件。

也想出现在这里?联系我们
创客主机
  1. <link rel='stylesheet' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'>

HTML 结构

该登录界面的基本 HTML 结构如下:

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-offset-3 col-md-6">
  4.             <form class="form-horizontal">
  5.                 <span class="heading">用户登录</span>
  6.                 <div class="form-group">
  7.                     <input type="email" class="form-control" id="inputEmail3" placeholder="用户名或电子邮件">
  8.                     <i class="fa fa-user"></i>
  9.                 </div>
  10.                 <div class="form-group help">
  11.                     <input type="password" class="form-control" id="inputPassword3" placeholder="密 码">
  12.                     <i class="fa fa-lock"></i>
  13.                     <a href="#" class="fa fa-question-circle"></a>
  14.                 </div>
  15.                 <div class="form-group">
  16.                     <div class="main-checkbox">
  17.                         <input type="checkbox" value="None" id="checkbox1" name="check"/>
  18.                         <label for="checkbox1"></label>
  19.                     </div>
  20.                     <span class="text">Remember me</span>
  21.                     <button type="submit" class="btn btn-default">登录</button>
  22.                 </div>
  23.             </form>
  24.         </div>
  25.     </div>
  26. </div>

CSS 样式

为登录界面添加下面的 CSS 样式:

  1. .form-bg{
  2.     background: #00b4ef;
  3. }
  4. .form-horizontal{
  5.     background: #fff;
  6.     padding-bottom: 40px;
  7.     border-radius: 15px;
  8.     text-align: center;
  9. }
  10. .form-horizontal .heading{
  11.     display: block;
  12.     font-size: 35px;
  13.     font-weight: 700;
  14.     padding: 35px 0;
  15.     border-bottom: 1px solid #f0f0f0;
  16.     margin-bottom: 30px;
  17. }
  18. .form-horizontal .form-group{
  19.     padding: 0 40px;
  20.     margin: 0 0 25px 0;
  21.     position: relative;
  22. }
  23. .form-horizontal .form-control{
  24.     background: #f0f0f0;
  25.     border: none;
  26.     border-radius: 20px;
  27.     box-shadow: none;
  28.     padding: 0 20px 0 45px;
  29.     height: 40px;
  30.     transition: all 0.3s ease 0s;
  31. }
  32. .form-horizontal .form-control:focus{
  33.     background: #e0e0e0;
  34.     box-shadow: none;
  35.     outline: 0 none;
  36. }
  37. .form-horizontal .form-group i{
  38.     position: absolute;
  39.     top: 12px;
  40.     left: 60px;
  41.     font-size: 17px;
  42.     color: #c8c8c8;
  43.     transition : all 0.5s ease 0s;
  44. }
  45. .form-horizontal .form-control:focus + i{
  46.     color: #00b4ef;
  47. }
  48. .form-horizontal .fa-question-circle{
  49.     display: inline-block;
  50.     position: absolute;
  51.     top: 12px;
  52.     right: 60px;
  53.     font-size: 20px;
  54.     color: #808080;
  55.     transition: all 0.5s ease 0s;
  56. }
  57. .form-horizontal .fa-question-circle:hover{
  58.     color: #000;
  59. }
  60. .form-horizontal .main-checkbox{
  61.     float: left;
  62.     width: 20px;
  63.     height: 20px;
  64.     background: #11a3fc;
  65.     border-radius: 50%;
  66.     position: relative;
  67.     margin: 5px 0 0 5px;
  68.     border: 1px solid #11a3fc;
  69. }
  70. .form-horizontal .main-checkbox label{
  71.     width: 20px;
  72.     height: 20px;
  73.     position: absolute;
  74.     top: 0;
  75.     left: 0;
  76.     cursor: pointer;
  77. }
  78. .form-horizontal .main-checkbox label:after{
  79.     content: "";
  80.     width: 10px;
  81.     height: 5px;
  82.     position: absolute;
  83.     top: 5px;
  84.     left: 4px;
  85.     border: 3px solid #fff;
  86.     border-top: none;
  87.     border-right: none;
  88.     background: transparent;
  89.     opacity: 0;
  90.     -webkit-transform: rotate(-45deg);
  91.     transform: rotate(-45deg);
  92. }
  93. .form-horizontal .main-checkbox input[type=checkbox]{
  94.     visibility: hidden;
  95. }
  96. .form-horizontal .main-checkbox input[type=checkbox]:checked + label:after{
  97.     opacity: 1;
  98. }
  99. .form-horizontal .text{
  100.     float: left;
  101.     margin-left: 7px;
  102.     line-height: 20px;
  103.     padding-top: 5px;
  104.     text-transform: capitalize;
  105. }
  106. .form-horizontal .btn{
  107.     float: right;
  108.     font-size: 14px;
  109.     color: #fff;
  110.     background: #00b4ef;
  111.     border-radius: 30px;
  112.     padding: 10px 25px;
  113.     border: none;
  114.     text-transform: capitalize;
  115.     transition: all 0.5s ease 0s;
  116. }
  117. @media only screen and (max-width: 479px){
  118.     .form-horizontal .form-group{
  119.         padding: 0 25px;
  120.     }
  121.     .form-horizontal .form-group i{
  122.         left: 45px;
  123.     }
  124.     .form-horizontal .btn{
  125.         padding: 10px 20px;
  126.     }
  127. }

基于 Bootstrap 的简洁登录界面设计效果

已有 1465 人购买
  • x4ox
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(6)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!