首页 > 代码库 > 开发bootstrap的from表单事例

开发bootstrap的from表单事例

<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=http://www.mamicode.com/"../file/jquery.js" type="text/javascript"></script>
    <link href=http://www.mamicode.com/"../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=http://www.mamicode.com/"登录" />
     </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=http://www.mamicode.com/"../file/jquery.js" type="text/javascript"></script>
    <link href=http://www.mamicode.com/"../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=http://www.mamicode.com/"登录" />
           </div>
        </div>
   </form>
</body>
</html>

效果图:

 

 

 

开发bootstrap的from表单事例