简洁好看的登录页面

简介: 这是一个简洁美观的登录页面设计,包含HTML和CSS代码。页面背景为渐变色,中央有一个白色的登录框,内含账号和密码输入字段、登录按钮以及注册链接。登录框下方有动态的正方形和圆形元素动画,通过CSS关键帧动画实现旋转和透明度变化。

简洁好看的登录页面

1.看效果
!image.png
2.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <link rel="stylesheet" href="static/login.css">
</head>
<body>
  <div class="container">
      <div class="tit">登录</div>
      <input type="text" placeholder="账号">
      <input type="password" placeholder="密码">
      <button>登录</button>
      <span>没有账号?<a href="#">去注册</a> </span>
  </div>
  <div class="square">
      <ul>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
      </ul>
  </div>
  <div class="circle">
      <ul>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
      </ul>
  </div>
</body>
</html>

2.css

*{
   
   
    /*初始化*/
    margin: 0;
    padding: 0;
}
body{
   
   
    height: 100vh;
    /*弹性布局居中*/
    display: flex;
    justify-content: center;
    align-items: center;
    /*渐变背景*/
    background: linear-gradient(200deg,#e3c5eb,#a9c1ed);
   /*溢出影藏*/
    overflow: hidden;
}
.container{
   
   
    /*相对定位*/
    position: relative;
    z-index: 1;
    background-color: #fff;
    border-radius: 15px;
    display: flex;
    /*垂直配列*/
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 350px;
    height: 500px;
    /*阴影*/
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.container .tit{
   
   
    font-size: 26px;
    margin: 65px auto 70px auto;
}
.container input{
   
   
    width: 280px;
    height: 30px;
    text-indent: 8px;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    margin: 12px auto;
}
.container button{
   
   
    width: 280px;
    height: 40px;
    margin: 35px auto 40px auto;
    border: none;
    background: linear-gradient(-200deg,#fac0e7,#aac2ee);
    color: #fff;
    font-weight: bold;
    letter-spacing: 8px;
    border-radius: 10px;
    cursor: pointer;
    /*动画过渡*/
    transition: 0.5s;
}
.container button:hover{
   
   
    background: linear-gradient(-200deg,#aac2ee,#fac0e7);
    background-position-x: -280px;
}
.container span{
   
   
    font-size: 14px;
}
.container a{
   
   
    color: plum;
    text-decoration: none;
}

ul li{
   
   
    position: absolute;
    border: 1px solid #fff;
    background-color: #ffffff;
    width: 30px;
    height: 30px;
    list-style: none;
    opacity: 0;
}
.square li{
   
   
    top: 40vh;
    left: 60vw;
    animation: square 10s linear infinite;
}
.square li:nth-child(2){
   
   
    top: 80vh;
    left: 10vm;
    /*动画延时时间*/
    animation-delay: 2s;
}
.square li:nth-child(3){
   
   
    top: 80vh;
    left: 85vm;
    /*动画延时时间*/
    animation-delay: 4s;
}

.square li:nth-child(4){
   
   
    top: 10vh;
    left: 70vm;
    /*动画延时时间*/
    animation-delay: 6s;
}

.square li:nth-child(5){
   
   
    top: 10vh;
    left: 10vm;
    /*动画延时时间*/
    animation-delay: 8s;
}

.circle li{
   
   
    bottom: 0;
    left: 15vw;
    animation: circle 10s linear infinite;
}
.circle li:nth-child(2){
   
   
    left: 35vw;
    animation-delay: 2s;
}
.circle li:nth-child(3){
   
   
    left: 55vw;
    animation-delay: 4s;
}
.circle li:nth-child(4){
   
   
    left: 75vw;
    animation-delay: 6s;
}
.circle li:nth-child(5){
   
   
    left: 90vw;
    animation-delay: 8s;
}

@keyframes square {
   
   
    0%{
   
   
       transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    100%{
   
   
        transform: scale(0) rotate(1000deg);
        opacity: 0;
    }

}
@keyframes circle{
   
   
    0%{
   
   
        transform: scale(0) rotate(0deg);
        opacity: 1;
        bottom: 0;
        border-radius: 0;
    }
    100%{
   
   
        transform: scale(0) rotate(1000deg);
        opacity: 0;
        bottom: 90vh;
        border-radius: 50%;
    }

}

记得点赞哦
在这里插入图片描述

目录
相关文章
|
4月前
|
移动开发 JavaScript API
如何保证 UniApp 插件接口与 UniApp 规范兼容?
如何保证 UniApp 插件接口与 UniApp 规范兼容?
360 137
|
10月前
|
人工智能 自然语言处理 安全
90.9K star!一键部署AI聊天界面,这个开源项目让大模型交互更简单!
"像使用微信一样操作大模型!Open WebUI 让AI对话从未如此简单"
1111 0
|
前端开发 UED 容器
登录页视觉升级:CSS动画背景,让登录变得酷炫!
登录页视觉升级:CSS动画背景,让登录变得酷炫!
|
前端开发 中间件
React Proxy 详细流程与配置方式(webpack、setupProxy.js、package.json)
React Proxy 详细流程与配置方式(webpack、setupProxy.js、package.json)
615 0
|
关系型数据库 MySQL 数据库连接
如何处理WordPress网站提示“建立数据库连接时出错”
如何处理WordPress网站提示“建立数据库连接时出错”
|
网络协议 网络性能优化 数据中心
什么是显式拥塞通知ECN?
【4月更文挑战第23天】
1557 0
什么是显式拥塞通知ECN?
|
JavaScript 前端开发 安全
一个贼丝滑的 Vue 2 扩展组件,开源且免费
一个贼丝滑的 Vue 2 扩展组件,开源且免费
|
关系型数据库 数据挖掘 数据库
PostgreSQL 模糊查询最佳实践 - (含单字、双字、多字模糊查询方法)
PostgreSQL 模糊查询最佳实践 - (含单字、双字、多字模糊查询方法)https://github.com/digoal/blog/blob/master/201704/20170426_01.md
14691 0
|
缓存 网络协议 程序员
解决GitHub下载速度太慢问题的方法汇总(持续更新,建议收藏)
解决GitHub下载速度太慢问题的方法汇总(持续更新,建议收藏)