bootstrap 中的水平表单

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap -->
    <link href="__STATIC__/插件/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
    <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
        
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="__STATIC__/插件/jquery-3.3.1.min.js"></script>
    <script src="__STATIC__/插件/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <title>bootstrap</title>
    <style>

    </style>
</head>
<body>

<div class="container">

            <!-- role="form"支持无障碍设备、方便残疾人
            class="form-horizontal":声明水平表单 -->
            <form action="" role="form" class="form-horizontal">
                <!-- fieldset:表单域 -->
                <fieldset>
                    <!-- legend:表单标题 -->
                    <legend class="text-center">用户登录</legend>
                    <!-- 表单控件 -->
                    <div class="form-group">
                        <!-- class="sr-only":隐藏label -->
                        <label for="name" class="col-md-2  control-label">用户名称</label>
                            <div class="col-md-10">
                                <input type="text" class="form-control" id="name" placeholder="用户名称/手机/邮箱">
                            </div>
                    
                    </div>

                    <div class="form-group">
                        <label for="passwd" class="col-md-2 control-label">密码:</label>
                        <div class="col-md-10">
                            <input type="text" class="form-control" id="passwd" placeholder="密码">
                        </div>
                    </div>
                    <div class="col-md-10 col-md-offset-2">
                        <div class="form-group">
                                <!-- btn btn-info btn-block:按钮,info类型按钮(蓝色背景),100%显示 -->
                             <button type="submit" name="button" class="btn btn-info btn-block">提交</button>
                        </div>
                    </div>
                </fieldset>
            </form>

</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/cl94/p/9061126.html