发布于 2015-01-15 12:55:15 | 494 次阅读 | 评论: 0 | 来源: PHPERZ

这里有新鲜出炉的Bootstrap入门,程序狗速度看过来!

Bootstrap Web前端CSS框架

Bootstrap是Twitter推出的一个开源的用于前端开发的工具包。它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架。Bootstrap提供了优雅的HTML和CSS规范,它即是由动态CSS语言Less写成。Bootstrap一经推出后颇受欢迎,一直是GitHub上的热门开源项目,包括NASA的MSNBC(微软全国广播公司)的Breaking News都使用了该项目。


本文为大家提供的是一个bootstrap实现的登录表单示例代码,感兴趣的同学参考下。

示例代码

<html lang="en">
<head>
    <title>form</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <script src="../file/jquery.js" type="text/javascript"></script>
    <link href="../book/css/bootstrap.css" rel="stylesheet" type="text/css" />
</head>
<body>
   <form class="form-inline">
     <fieldset>
        <legend>用户登录</legend>
        <div class="form-group">
            <label>用户名:</label>
            <input type="text" class="form-control" placeholder="请输入您的用户名!" />
        </div>
        <div class="form-group">
            <label>密码:</label>
            <input type="password" class="form-control" placeholder="请输入您的密码!" />
        </div>
        <div class="checkbox">
           <label><input type="checkbox" />记住密码</label>
        </div>
        <input type="button" class="btn btn-default" value="登录" />
     </fieldset>
   </form>
  
</body>
</html>

效果图

垂直表单示例

<html lang="en">
<head>
    <title>form</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <script src="../file/jquery.js" type="text/javascript"></script>
    <link href="../book/css/bootstrap.css" rel="stylesheet" type="text/css" />
</head>
<body>
     <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 control-label">用户名:</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="请输入您的用户名!" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">密码:</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" placeholder="请输入您的密码!" />
            </div>
        </div>
        <div class="form-group">
           <div class="col-sm-offset-2 col-sm-10">
              <div class="checkbox">
                 <label><input type="checkbox" />记住密码</label>
              </div>
           </div>
        </div>
        <div class="form-group">
           <div class="col-sm-offset-2 col-sm-10">
              <input type="button" class="btn btn-default" value="登录" />
           </div>
        </div>
   </form>
</body>
</html>

效果图



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务