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

article/2025/11/3 15:29:02

1. 效果图展示

在这里插入图片描述

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;
}

http://chatgpt.dhexx.cn/article/gv65ZRr5.shtml

相关文章

HTML制作用户登录界面

1、index代码 <!doctype html> <html><head><meta charset"utf-8"><title>login</title><link rel"stylesheet" type"text/css" href"css/index.css"/></head><body><div&…

登录界面html源代码_网页制作:一个简易美观的登录界面

登录界面html源代码_网页制作&#xff1a;一个简易美观的登录界面 效果图 在我们做一个页面之前&#xff0c;要先想好他的一个整体布局&#xff0c;也就是我们这里面的login.html主页面&#xff0c;大致结构如下&#xff1a; 接下来&#xff0c;我们先上代码&#xff0c;看一…

HTML+CSS登陆界面实例

登录界面截图 项目代码仓库地址 项目的代码放在了github的代码仓库当中&#xff1a;点我 项目访问地址 将登录界面项目部署在了github上面&#xff1a;点我 项目代码解析 项目的界面简析 主要部分是Login的模块&#xff0c;包括username文本框和password文本框以及Login的…

HTML+CSS登录注册界面

目录 一、效果演示二、代码实现2.1、HTML主页面2.2、CSS代码2.3、JS代码 一、效果演示 [注]: 这里需要我们创建三个文件&#xff0c;一个是index.html文件&#xff0c;一个是style.css文件还有一个是login.js文件&#xff0c;把代码copy上去 只要路径找好就能正常运行了。 演示…

HTML+CSS登录界面

今天学习了一个HTML+CSS登录界面 效果图如下: 背景图片可以选取自己喜欢的,以下是实现代码: login.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>登录</title> <link rel="stylesheet&quo…

HTMLCSS登录界面及讲解

PS:该源码非原创&#xff0c;原文章来自(2条消息) HTMLCSS登录界面_桐艾的博客-CSDN博客_登录页面 这里只做源码讲解 页面效果如下&#xff1a; 首先是login.html <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>登…

好看的html登录界面,

界面效果&#xff1a; 代码&#xff1a; <!DOCTYPE html> <html><head><title>Login Page</title><style>body {background-color: #f2f2f2;font-family: Arial, sans-serif;}form {background-color: #fff;border-radius: 5px;box-shado…

HTML简单登录界面的实现

简单登录界面的实现&#xff1a; 直接一个实例上代码&#xff1a; <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"&…

html好看的登录界面2(十四种风格登录源码)

文章目录 1.登录风格效果说明1.1 凹显风登录界面1.2 大气简洁风登录界面1.3 弹出背景风登录界面1.4 动态左右切换风登陆界面1.5 简洁背景切换登录界面1.6 可关闭登录界面1.7 蒙蒙山雨风登录界面1.8 苹果弹框风登录界面1.9 上中下青春风登录界面1.10 夏日风登录界面1.11 星光熠熠…

html+css唯美登录页面,代码提供(效果展示)

文章目录 效果图所有代码 效果图 所有代码 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content"IEedge"><meta name"viewport" co…

使用 ELK 收集日志

在当前分布式、微服务架构下&#xff0c;各个应用都部署在不同的服务器上&#xff0c;每个应用都在记录着自己重要或者不重要的日志信息。当我们要通过日志信息来排查错误时&#xff0c;可以根据出错应用在对应的机器上找报错相关的日志信息。但是&#xff0c;可能我们不具有相…

ELK日志分析

目录 一、概述 ELK工作原理 二、Elasticsearch 1.介绍 2.基础核心概念 (1)接近实时&#xff08;NRT&#xff09; (2)集群&#xff08;cluster&#xff09; (3)节点&#xff08;node&#xff09; (4)索引&#xff08;index&#xff09; (5)类型&#xff08;type&…

ELK日志分析系统(一)之ELK原理

文章目录 前言一、ELK简介1.ELK日志分析系统组成1.1Elasticsearch&#xff08;es&#xff09;1.2Logstash1.3Kibana 2.日志处理步骤 二、Elasticsearch1.Elasticsearch概述2.Elasticsearch核心概念2.1接近实时&#xff08;NRT&#xff09;2.2集群&#xff08;cluster&#xff0…

ELK相关软件下载安装

一、Windows安装elasticsearch 1、安装JDK&#xff0c;至少1.8.0_73以上版本&#xff0c;验证&#xff1a;java -version 2、下载和解压缩Elasticsearch安装包&#xff0c;查看目录结构 下载地址&#xff1a;https://www.elastic.co/cn/downloads/elasticsearch 目录结构&am…

ELK日志分析系统

目录 一、ELK日志分析系统 1、日志分析 2、elk 日志分析的工具 3、Logstash 4、elasticsearch介绍 5、Elasticsearch的基础核心概念 7、logstash介绍 8、Kibana介绍 二、实验 1、配置elasticsearch环境 2、安装elasticsearch-head插件 3、安装logstash 4、在node1主…

centos7搭建elk

ELK 是 ElasticSearch、 LogStash、 Kibana 三个开源工具的简称,现在还包括 Beats,其分工如下: LogStash/Beats: 负责数据的收集与处理ElasticSearch: 一个开源的分布式搜索引擎,负责数据的存储、检索和分析Kibana: 提供了可视化的界面。负责数据的可视化操作基于 ELK Stack…

ELK简介

目录 1.什么是ELK 2.为什么使用ELK 3.ELK的工作流程简介 4.ELK重点组件介绍 ①Filebeat工作原理&#xff1a; ②Logstash工作原理&#xff1a; 5.ELK架构举例 ①&#xff1a; ②&#xff1a; ③&#xff1a; 1.什么是ELK ELK是三个开源软件的缩写&#xff0c;分别是E…

ELK分布式日志解决方案

一、简介 ELK&#xff0c;包含三款产品&#xff0c;Elasticsearch、Logstash、Kibana&#xff0c;可在项目中作为日志框架使用。 项目中框架整合所需技术&#xff1a; 在整个方案中&#xff0c;各组件的作用如下&#xff1a; 应用服务 生产日志&#xff0c;通过Logger产生日…

ElasticSearch(九):ELK 架构

日志收集——》格式化分析——》检索和可视化——》风险告警 ELK架构 经典的ELK整合消息队列Nginx架构 什么是Logstash Logstash核心概念Logstash数据传输原理Logstash配置文件结构Logstash QueueLogstash导入数据到ES同步数据库数据到Elasticsearch 什么是Beats FileBeat简介…

ELK入门

整体思路 filebeat采集数据--->Kafka--->Logstash提取Kafka--->ES-->Kibana可视化 ElasticSearch 首次启动时&#xff0c;密码在控制台日志中, 建议保留首次运行时的日志 elk 下载地址&#xff1a; 下载 Elastic 产品 | Elastic -> Elasticsearch security f…