注册页面垂直居中

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
 <meta charset="utf-8" />
    <link href="Content/bootstrap.min.css" rel="stylesheet" />
    <style>
        .center{
            height:300px;
            position:absolute;
            top:0;
            left:0;
            bottom:0;
            right:0;
            margin:auto;
        }
    </style>
</head>
<body>
    <form>
        <div class="container-fluid">
            <div class="col-md-3 col-md-offset-4 center">
                <fieldset>
                    <legend>用户注册</legend>
                    <div class="form-group">
                        <label for="exampleInputEmail1">邮箱</label>
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="请输入邮箱地址">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">密码</label>
                        <input type="password" class="form-control" id="exampleInputPassword1" placeholder="请输入密码">
                    </div>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox"> 记住我
                        </label>
                    </div>
                    <button type="submit" class="btn btn-default">注册</button>
                </fieldset>
            </div>
        </div>
    </form>
</body>
</html>

posted @ 2017-05-17 11:28  LMXA  阅读(548)  评论(0编辑  收藏  举报