前端学习————css实现简单登录页面

一、页面展示

在这里插入图片描述

二、思路

1.设置背景图片

2.设置登录框框并使其处于靠右位置

3.设置登录框框内容

三、代码展示

1.HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="./login.css">
</head>
<body>
      <div class="form">
        <h2>
          <span>登录</span>
        </h2>
        <div class="item">
          <input type="text" placeholder="账号">
        </div>
        <div class="item">
          <input type="password" placeholder="密码">
        </div>
        <div class="button">
          <button>登录</button>
        </div>
        <div class="last">
            <last>———————其他方式登录———————</last>
        </div>
      </div>
</body>
</html>

2.css

在css里面设置背景图片

body{
    background: url("img/6.jpg");
}
.form{
    width: 420px;
    height: 550px;
    border: 1px solid rgb(126,117,117);
    margin-left: 850px;
    margin-top: 130px;
    /*background-color: rgb(94,93,91,.11);*/
    border-radius: 6mm;
    background-color: seashell;
}
.form h2{
    font-family: "Agency FB";
    text-align: center;
    font-size: 30px;
    color: black;
    border-bottom: 1px solid rgb(105,105,105);
    height: 50px;
    margin-bottom: 40px;
}
input[type="text"],input[type="password"]{
    border: 1px solid #dcdfe6;
    width: 75%;
    box-sizing: border-box;
    border-radius: 3px;
    height: 50px;
    text-indent: 1em;
    font-size: 14px;
    color: black;
    margin: 16px 48px;
    background-color: rgb(126,117,117,.20);
    /*background-image: linear-gradient(95deg,rgba(111,399,99,0.61),rgba(111,4557,180,0.5));*/
    background-image: linear-gradient(95deg,rgba(114,114,202,.3),rgba(90,187,182,0.5));
}
input[type="text"]::placeholder,input[type="password"]::placeholder{
    color: black;
}
input[type="text"]:hover,input[type="password"]:hover{
    border-color: #33476e;
}
.form .button{

}
button{
    width: 85px;
    height: 30px;
    margin: 45px 170px;
    background-color: #dcdfe6;
    background-image: linear-gradient(95deg,rgba(114,114,202,.3),rgba(90,187,182,0.5));
}
.last{
    margin:30px 50px ;
    font-size: 15px;
    color: grey;
}
  • 7
    点赞
  • 78
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值