bootstrap笔记(七)——表单样式

2021-06-11 11:39:34 浏览数 (1)

代码语言:javascript复制
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--支持移动设备优先-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--引入css文件-->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <!--引入bootstrap.js之前一定要先引入jQuery.js文件-->
    <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
</head>
<body>
    <div class="container">
        <form action="" class="form-horizontal">
            <!--栅格系统 是由行和列组成的 class="form-group"表示列-->
            <div class="form-group">
                <label for="user" class="col-md-2 control-label">用户名</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="user" placeholder="用户名">
                </div>
            </div>
            <div class="form-group">
                <label for="pass" class="col-md-2 control-label">密码</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="pass" placeholder="密码">
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-4 col-md-offset-2">
                    <div class="radio">
                        <label>
                            <input type="checkbox"> 记住密码
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-4 col-md-offset-2">
                    <button type="submit" class="btn btn-success">提交</button>
                </div>
            </div>
        </form>
    </div>
</body>
</html>

0 人点赞