一个登录网页

一、目的
   完成一个登录页面

二、主要步骤
    1、新建文件夹,新建index.html style.css
    2、​编辑文章使用link链接
    3、HTML部分
        <form>
            文本框text
            br换行
            密码框 password
            br换行
            按钮 button
            br换行
            p标签
        </form>
    4、CSS部分
        ①给body设置背景图 bgi
        ②给form设置绝对定位,让他水平垂直都居中
            position:absolute;
            left:50%;
            top:50%;

        ③给input,设置width height border-radius 
          取消边框border:none;
                ④给按钮起个class名,设置背景色bgc,文字颜色白色
          文字大小font-size
        ⑤给p设置居中 text-align:center;

三、代码部分

1、html部分

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
    <!-- 建立form表单 -->
    <form action="">
    <!-- 账户 -->
       <input class="account" type="account" name="" value="" placeholder="账户"> 
       <br />
       <!-- 密码 -->
       <input class="password" type="password" name="" value="" placeholder="密码">
       <br />
       <!-- 登录 -->
       <input class="login" type="submit" name="" value="登录">
       <!-- 设置文本 -->
       <p>版权所有&copyhqyj.com</p>
    </form>
    </body>
</html>

2、css部分

body{
    /*插入背景图*/
    background-image: url(image/bgt.jpeg);
}


/*绝对定位,水平垂直都居中*/

form{
    position: absolute;
    left:50%;
    top:50%;
}

.account{
    /*调整高度+宽度*/
    width: 340px;
    height: 50px;
    /*设置边框圆角*/
    border-radius:20px;
    /*取消边框线*/
    border: none;
 

}

.password{
     /*调整高度+宽度*/
    width: 340px;
    height: 50px;
    /*设置边框圆角*/
    border-radius:20px;
    /*取消边框线*/
    border: none;

}

.login{
    width: 340px;
    height: 42px;
    /*设置背景色*/
    background-color:#6daccf;
    /*设置文字大小*/
    font-size: 20px;
    border: none;
    color:#fff;
    /*文本文字加粗*/
    font-weight: bold;
    /*调整登录文本框居中*/
    margin-left: 10px;


}

p{
    /*文本居中*/
    text-align: center;
    margin-top: -2px;

}

input{
    /*边框上下间距*/
    margin:5px;
    /*边框内边距*/
    padding-left: 11px;
}

四、效果图

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值