Bootstrap登录页面制作(十三)

创建web项目 

 

 

 

引入bootstrap:

 

创建login页面引入bootstrap:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <!--引入bootstrap的css-->
    <link rel="stylesheet" href="../static/css/bootstrap.min.css">
    <!--引入jQuery的文件-->
    <script src="../static/jq/jquery-3.6.0.js"></script>
    <!--引入bootstrap的js文件-->
    <script src="../static/js/bootstrap.min.js"></script>
</head>
<body>

</body>
</html>

刷新页面F12在NetWork查看是否引入成功: 

 

<!--用户标题-->
   <div class="row" style="margin-top: 70px">
       <!--偏移3分占6分-->
       <div class="col-sm-6 col-sm-offset-3">
           <h1 class="text-center">用户登录</h1>
       </div>
   </div>

 

 

<!--用户表单-->
<div class="row">
    <!--偏移3分占6分-->
    <div class="col-sm-6 col-sm-offset-3">
        <!--表单-->
        <form>
            <div class="form-group">
                <label for="exampleInputEmail1">Email address</label>
                <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">Password</label>
                <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
            </div>
            <div class="form-group">
                <label for="exampleInputFile">File input</label>
                <input type="file" id="exampleInputFile">
                <p class="help-block">Example block-level help text here.</p>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox"> Check me out
                </label>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
</div>

 

修改表单:

 

<!--用户表单-->
<div class="row">
    <!--偏移3分占6分-->
    <div class="col-sm-6 col-sm-offset-3">
        <!--表单-->
        <form>
            <div class="form-group">
                <label for="name">用户名</label>
                <input type="email" class="form-control" id="name" placeholder="请输入用户名">
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" placeholder="请输入密码">
            </div>
            <div class="form-group">
                <label for="code">验证码</label>
                <div>
                    <input type="text" class="form-control" style="width: 70%; height:55px;float: left;" id="code" placeholder="请输入验证码">
                    <img src="../static/imgs/22.png" style="float:right;width: 220px;height: 55px">
                </div>

            </div>
            <div class="clearfix"></div>
            <button type="submit" class="btn btn-danger" style="margin-top: 10px;float:left;width: 65%">登录</button>
            <button type="submit" class="btn btn-info" style="margin-top: 10px;float: right;width: 25%">登录</button>
        </form>
    </div>
</div>

 

全部登录代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <!--引入bootstrap的css-->
    <link rel="stylesheet" href="../static/css/bootstrap.min.css">
    <!--引入jQuery的文件-->
    <script src="../static/jq/jquery-3.6.0.js"></script>
    <!--引入bootstrap的js文件-->
    <script src="../static/js/bootstrap.min.js"></script>
    <style>
        .form-control{
            height: 45px;
        }
    </style>
</head>
<body>
<!--用户标题-->
   <div class="row" style="margin-top: 70px">
       <!--偏移3分占6分-->
       <div class="col-sm-6 col-sm-offset-3">
           <h1 class="text-center">用户登录</h1>
       </div>
   </div>
<!--用户表单-->
<div class="row">
    <!--偏移3分占6分-->
    <div class="col-sm-6 col-sm-offset-3">
        <!--表单-->
        <form>
            <div class="form-group">
                <label for="name">用户名</label>
                <input type="email" class="form-control" id="name" placeholder="请输入用户名">
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" placeholder="请输入密码">
            </div>
            <div class="form-group">
                <label for="code">验证码</label>
                <div>
                    <input type="text" class="form-control" style="width: 70%; height:55px;float: left;" id="code" placeholder="请输入验证码">
                    <img src="../static/imgs/22.png" style="float:right;width: 220px;height: 55px">
                </div>

            </div>
            <div class="clearfix"></div>
            <button type="submit" class="btn btn-danger" style="margin-top: 10px;float:left;width: 65%">登录</button>
            <button type="submit" class="btn btn-info" style="margin-top: 10px;float: right;width: 25%">登录</button>
        </form>
    </div>
</div>
</body>
</html>

 

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

喵俺第一专栏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值