Html设计页面之绿色简约登录页面

Html设计页面之绿色简约登录页面

        1. 效果展示

        2.代码展示

        HTML代码:

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>绿色简约登录页面</title>
  <link rel="stylesheet" href="css/004.css">
</head>

<body>
  <img src="./image/GreenLeaves.png">
  <div class="container">
    <div class="login">Login</div>
    <div class="form-wrapper">
      <input type="text" name="username" placeholder="请输入用户名" class="input-item">
      <input type="password" name="password" placeholder="请输入密码" class="input-item">
    </div>
    <div class="prove">
      <input type="text" name="password" placeholder="请输入验证码" class="input_prove">
      <input type="button" value="获取验证码" class="button">
    </div>
    <div class="signIn">登录</div>
    <div class="msg">
      <a href="#">Sign up</a>
    </div>
  </div>
</body>

</html>

        CSS代码:

* {
  margin: 0;
  padding: 0;
}
/* 居中对齐 */
body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* 背景图片设计 */
img {
  position: absolute;
  width: 100%;
  height: 100%;
}

.container {
  position: relative;
  width: 358px;
  height: 588px;
  border-radius: 15px;
  /* 表单的内边距 */
  padding: 0 50px;
  /* 表单的背景颜色 */
  background-color: white;
  /* 设置立体效果 */
  box-shadow: 5px 5px 5px rgb(166, 181, 146), -5px -5px 5px white;
}

.login {
  /* 设计字体大小,粗细 */
  font-size: 38px;
  font-weight: bold;
  line-height: 200px;
  /* 字体居中 */
  text-align: center;
  /* 字体渐变 */
  background-image: -webkit-linear-gradient(top,lightgreen 50%,LawnGreen 40%,green 60%);
  -webkit-background-clip:text; 
  -webkit-text-fill-color:transparent;
}
/* 用户名和密码设计 */
.input-item {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  border: 0;
  padding: 10px;
  border-bottom: 1px solid rgb(128,125,125);
  font-size: 15px;
  outline: none;
}
/* 验证码设计 */
.prove {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgb(128,125,125);
}

.input_prove {
  border: 0;
  font-size: 15px;
  padding: 10px;
  /* 不显示轮廓线 */
  outline: none;
}

.button {
  border: 0;
  font-size: 15px;
  outline: none;
  float: right;
  text-align: bottom;
  background-color: white;
}

/* 提示字体颜色 */
input[value], .input_prove::placeholder, .input-item::placeholder {
  color: rgb(112, 159, 112);
}

.signIn {
  text-align: center;
  padding: 10px;
  width: 100%;
  margin-top: 40px;
  background-color: lightgreen;
  color: #fff;
}

.msg {
  text-align: center;
  line-height: 88px;
}

a {
  text-decoration-line: none;
  color: LimeGreen;
}

  • 22
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
HTML和CSS是前端开发中的两种基本技术,可以用来创建简约登录注册页面登录页面一般包括一个登录表单,其中包含用户名和密码的输入框,以及一个登录按钮。 注册页面一般包括一个注册表单,其中包含用户名、密码和确认密码的输入框,以及一个注册按钮。 在HTML中,可以使用```<form>```标签创建表单,用```<input>```标签创建输入框,用```<button>```标签创建按钮。使用CSS可以设置表单和输入框的样式,例如设置宽度、边框样式、背景颜色等。 以下是一个使用HTML和CSS创建简约登录注册页面的示例: ```html <!DOCTYPE html> <html> <head> <title>登录注册页面</title> <style> form { width: 300px; margin: 0 auto; padding: 20px; background-color: #f5f5f5; } input[type="text"], input[type="password"] { width: 100%; padding: 10px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ccc; } button { width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #45a049; } </style> </head> <body> <form> <h2>登录</h2> <input type="text" placeholder="用户名"> <input type="password" placeholder="密码"> <button type="submit">登录</button> </form> <form> <h2>注册</h2> <input type="text" placeholder="用户名"> <input type="password" placeholder="密码"> <input type="password" placeholder="确认密码"> <button type="submit">注册</button> </form> </body> </html> ``` 以上示例中,使用了```<form>```标签创建了两个表单,使用了```<input>```标签创建输入框,使用了```<button>```标签创建登录和注册按钮。通过CSS的样式设置,达到了简约登录注册页面效果。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值