HTML+CSS登录界面样式

效果展示:


代码:

index.html:
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>HTML</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <div class="Div1">
    <div class="imgBackgroundDiv">
      <img src="image.png">
    </div>
    <div class="textDiv">
      <h3>HELLO</h3>
      <input type="text" placeholder="Name">
      <input type="password" placeholder="Password">
    </div>
    <div class="buttonDiv">
      <button><b>Sign in</b></button>
    </div>
  </div>
</body>

</html>

style.css:
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

::placeholder {
  color: #C0C0C0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.Div1 {
  position: relative;
  background: #5560D4;
  width: 250px;
  height: 170px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 5px rgba(0, 0, 80, 0.3);
}

.imgBackgroundDiv {
  position: absolute;
  left: -55px;
  width: 170px;
  overflow: hidden;
}

.imgBackgroundDiv img {
  width: 100%;
}

.textDiv {
  position: absolute;
  width: 50%;
  padding: 5px;
  left: 120px;
}

.textDiv h3 {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 12px;
  text-shadow: 0 2px 3px rgba(0, 0, 80, 0.3);
}

.textDiv input {
  width: 100%;
  border: 2px solid #7B86FF;
  border-radius: 5px;
  margin-top: 10px;
  padding: 2.5px;
  color: #7F82A8;
}

.buttonDiv {
  position: absolute;
  width: 50%;
  left: 120px;
  bottom: 8px;
  padding: 5px;
  text-align: center;
}

.buttonDiv button {
  width: 98%;
  height: 23px;
  border: none;
  border-radius: 50px;
  background: #D2D5F4;
  color: #6E6D87;
  transition: 0.3s;
}

.buttonDiv button:hover {
  transform: scale(1.02);
  background: #fff;
  color: #000;
  box-shadow: 0 1px 4px rgba(0, 0, 50, 0.2);
}


感谢您看到这里~🥰

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值