HTML 实现好看的登录注册界面(一)

这篇具有很好参考价值的文章主要介绍了HTML 实现好看的登录注册界面(一)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

1. 效果图展示

HTML 实现好看的登录注册界面(一)文章来源地址https://www.toymoban.com/news/detail-492494.html

2. 代码

2.1 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.0" />
    <title>Document</title>
    <link rel="stylesheet" href="index.css" />
  </head>
  <body>
    <div class="container">
      <div class="box">
        <div class="transtion-box">
          <div class="login-box">
            <h1>欢迎回来</h1>
            <section>
              <label for="email">邮箱</label>
              <input type="text" id="email" />
            </section>
            <section>
              <label for="password">密码</label>
              <input type="password" id="password" />
              <span>忘记密码?</span>
            </section>
            <button type="button">登录</button>
            <button type="button" class="other">
              使用<span style="font-weight: 900; color: #455a81">二维码</span
              >扫码登录
            </button>
          </div>
          <div class="reg-box" style="display: none">
            <h1>立即注册</h1>
            <section>
              <label for="username">用户名</label>
              <input type="text" id="username" />
            </section>
            <section>
              <label for="email">邮箱</label>
              <input type="text" id="email" />
            </section>
            <section>
              <label for="password">密码</label>
              <input type="password" id="password" />
            </section>
            <button type="button">注册</button>
            <button type="button" class="other">
              使用<span style="font-weight: 900; color: #455a81">二维码</span
              >扫码注册
            </button>
          </div>
        </div>
        <div class="transferToReg">
          <h1 class="title">还未注册?</h1>
          <span class="subTitle">立即注册,发现大量机会!</span>
          <button type="button" id="transfetBtn">注册</button>
        </div>
      </div>
    </div>
  </body>
  <script>
    let transfer = document.getElementById('transfetBtn');
    transfer.addEventListener('click', function () {
      let login = document.querySelector('.login-box');
      let reg = document.querySelector('.reg-box');
      let total = document.querySelector('.transtion-box');
      let target = document.querySelector('.transferToReg');
      let title = document.querySelector('.title');
      let subTitle = document.querySelector('.subTitle');
      transfer.innerText === '注册'
        ? (() => {
            target.style.left = 0;
            total.style.left = 260 + 'px';
            transfer.innerText = '登录';
            title.innerText = '已有帐号?';
            subTitle.innerText = '有帐号就登录吧,好久不见了!';
            setTimeout(() => {
              login.style.display = 'none';
              reg.style.display = 'flex';
            }, 300);
          })()
        : (() => {
            target.style.left = 640 + 'px';
            total.style.left = 0;
            transfer.innerText = '注册';
            title.innerText = '还未注册?';
            subTitle.innerText = '立即注册,发现大量机会!';
            setTimeout(() => {
              login.style.display = 'flex';
              reg.style.display = 'none';
            }, 300);
          })();
    });
  </script>
</html>

2.2 CSS部分

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  width: 100%;
  height: 100%;
}
.container {
  width: 100%;
  height: 100vh;
  background-color: #ededed;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container .box {
  width: 900px;
  height: 550px;
  background: #fff;
  border-radius: 4px;
  position: relative;
}
.container .box .transtion-box {
  position: absolute;
  left: 0;
  transition: 0.5s all ease-in-out;
}
.container .box .transtion-box .login-box,
.reg-box {
  width: 640px;
  height: 100%;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  padding: 50px 30px;
}

.container .box .transtion-box h1 {
  margin-bottom: 35px;
}
.container .box .transtion-box section {
  display: flex;
  flex-flow: inherit;
  align-items: inherit;
  width: 100%;
  margin-bottom: 30px;
}
.container .box .transtion-box section label {
  font-size: 14px;
  color: #909399;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.container .box .transtion-box section input {
  width: 50%;
  outline: 0;
  border: none;
  font-size: 18px;
  color: tomato;
  text-align: center;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}
.container .box .transtion-box section span {
  color: rgb(80, 80, 77);
  font-size: 15px;
  cursor: pointer;
  margin-top: 18px;
}
.container .box .transtion-box button {
  width: 50%;
  padding: 6px 0;
  text-align: center;
  border: 3px solid #d4af7a;
  border-radius: 20px;
  background: #d4af7a;
  color: #fff;
  font-size: 17px;
  letter-spacing: 6px;
  text-indent: 6px;
  margin-bottom: 15px;
  cursor: pointer;
}
.container .box .transtion-box .other {
  border: 3px solid #d3dae9;
  background: #fff;
  color: rgb(124, 145, 184);
  font-weight: 600;
}
.container .box .transferToReg {
  width: 260px;
  height: 100%;
  background: linear-gradient(
    to bottom right,
    #0e92eb 0%,
    #5f90ec 50%,
    #b08fe5 100%
  );
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  position: absolute;
  left: 640px;
  top: 0;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  padding: 50px 0;
  color: white;
  transition: all 1s ease-in-out;
}
.container .box .transferToReg .title {
  margin-bottom: 10px;
  transition: all 0.3s ease-in-out;
}
.container .box .transferToReg button {
  margin-top: 260px;
  width: 50%;
  padding: 8px 0;
  border-radius: 14px;
  letter-spacing: 10px;
  text-indent: 10px;
  font-size: 18px;
  color: #fff;
  border: 3px solid #fff;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.container .box .transferToReg button:hover {
  border: 3px solid #206dfc;
}

到了这里,关于HTML 实现好看的登录注册界面(一)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • vue+element ui实现好看的登录界面

    闲暇之余使用vue+element ui制作了个登录界面 话不多说,先上图 下面直接上代码: 附加背景图片 喜欢的老爷们可以给小弟一键三连哦,后续小弟还会发更多作品

    2024年02月11日
    浏览(24)
  • html里面的好看的动画效果

    html里面的好看的动画效果,包括基本的平移,旋转,抖动,变色等动画效果,可以直接嵌入代码使用; 元素属性介绍 基本语法格式: transform:translate(x-value,y-value); x-value 指元素在 水平方向 上移动的距离, y-value 指元素在 垂直方向 上移动的距离。如果 省略了第二个参数

    2024年02月11日
    浏览(37)
  • OA系统登录界面(比较好看)

    2024年02月15日
    浏览(26)
  • HTML实现简单注册登录页面

    以下两个页面均只用HTML实现(其中注册若要添加号码与后面的登录密码判断,涉及到javascript的内容,本文只使用了html,后续会加上这些内容) 简单注册:(读者可以自行增加图片以及其他属性) 登录:    

    2024年02月11日
    浏览(33)
  • jsp +mysql 好看的登录与注册页面 动态背景

      需要建立以下五个文件:         在webcontent文件夹下面建立css文件,login.jsp与loginjudge.jsp,registcheck.jsp直接放到webcontent文件夹下面,normalize.min.css与login.css放到css文件里面 数据库我建立的是Td_Snacks,连接数据库账号和密码是root,111,不同的请自己修改代码 建立数据库Td

    2024年02月05日
    浏览(28)
  • 好看的登录页面login.html

    2024年02月12日
    浏览(46)
  • Android实现qq登录注册和好友列表界面

    学习Android已经有一个多月了,老师留了实现qq登陆注册和好友列表的作业,要求: 设计登录界面,注册界面和好友列表界面。 在登录界面输入用户名“ admin ”,密码“ abc123 ”后,判断用户名和密码是否正确。 若用户名或密码错误则给出相应提示:“用户名或密码输入有误

    2024年02月02日
    浏览(32)
  • springboot+vue+elementsUI 实现分角色注册登录界面

    一、项目简介 一共分为三个角色:管理员、用户、设计师 登录功能:账号+密码+身份选择,登录成功后跳转到各身份对应的页面 注册功能:只允许用户和设计师注册,用户可以直接注册成功,设计师提交材料后注册需要管理员审核成功后方可注册成功。 注册页面要求必填:

    2024年02月07日
    浏览(29)
  • html+css实现的登录界面

    留言 :如果对你有帮助,给博主点个免费的赞吧 ~ 创作不易,感谢支持!

    2023年04月14日
    浏览(28)
  • Unity3D制作注册登录界面,并实现场景跳转

    效果预览图片: 效果预览视频: 一、新建项目工程 1、打开Unity3D,新建一个项目,将其命名为“Login”。我这里用的版本是Unity2018.4.2f1,不同版本制作过程中的界面可能稍有不同,但是不影响具体功能的实现。 2、可以将样例场景SampleScene重命名为Login,最好做到见名知意。

    2024年02月03日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包