首页 > 代码库 > bootstrap的form表单控件的事例

bootstrap的form表单控件的事例

<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">
            <label class="col-sm-2 control-label">专业:</label>
            <div class="col-sm-10">
                <label class="checkbox-inline">
                   <input type="checkbox" value=http://www.mamicode.com/"体育" name="zhuangye" />体育
                </label>
                <label class="checkbox-inline">
                   <input type="checkbox" value=http://www.mamicode.com/"音乐" name="zhuangye" />音乐
                </label>
                <label class="checkbox-inline">
                   <input type="checkbox" value=http://www.mamicode.com/"数学" name="zhuangye" />数学
                </label>
                <label class="checkbox-inline">
                   <input type="checkbox" value=http://www.mamicode.com/"计算机" name="zhuangye" />计算机
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">爱好的运动:</label>
            <div class="col-sm-10">
                <select multiple="multiple">
                   <option>篮球</option>
                   <option>足球</option>
                   <option>跑步</option>
                   <option>跳高</option>
                   <option>跳远</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">性别:</label>
            <div class="col-sm-10">
                <input type="radio" name="sex" checked="checked" value=http://www.mamicode.com/"男"/>男
                <input type="radio" name="sex" checked="checked" value=http://www.mamicode.com/"女" />女
            </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的form表单控件的事例