五个拿来就能用的炫酷登录页面

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面我会给你提供一个简单的示例代码,实现一个炫酷登录界面。 HTML代码: ```html <!DOCTYPE html> <html> <head> <title>炫酷登录界面</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="login-box"> <h2>Login</h2> <form> <div class="user-box"> <input type="text" name="" required=""> <label>Username</label> </div> <div class="user-box"> <input type="password" name="" required=""> <label>Password</label> </div> <a href="#"> <span></span> <span></span> <span></span> <span></span> Submit </a> </form> </div> </body> </html> ``` CSS代码: ```css * { margin: 0; padding: 0; box-sizing: border-box; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #34495e; } .login-box { width: 500px; background: #191919; padding: 40px; border-radius: 10px; box-shadow: 0 0 20px #00000080; } .login-box h2 { color: #fff; text-align: center; margin-bottom: 30px; } .user-box { position: relative; } .user-box input { width: 100%; padding: 10px 0; font-size: 16px; color: #fff; margin-bottom: 30px; border: none; border-bottom: 1px solid #fff; outline: none; background: transparent; } .user-box label { position: absolute; top: 0; left: 0; padding: 10px 0; font-size: 16px; color: #fff; pointer-events: none; transition: .5s; } .user-box input:focus ~ label, .user-box input:valid ~ label { top: -20px; left: 0; color: #03a9f4; font-size: 12px; } a { display: inline-block; background: #03a9f4; padding: 10px 40px; color: #fff; font-size: 16px; text-decoration: none; border-radius: 30px; position: relative; overflow: hidden; transition: .5s; } a:hover { background: #fff; color: #03a9f4; } a span { position: absolute; display: block; } a span:nth-child(1) { top: 0; left: -100%; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #03a9f4); animation: animate1 1s linear infinite; } @keyframes animate1 { 0% { left: -100%; } 50% { left: 100%; } 100% { left: 100%; } } a span:nth-child(2) { top: -100%; right: 0; width: 2px; height: 100%; background: linear-gradient(180deg, transparent, #03a9f4); animation: animate2 1s linear infinite; animation-delay: .25s; } @keyframes animate2 { 0% { top: -100%; } 50% { top: 100%; } 100% { top: 100%; } } a span:nth-child(3) { bottom: 0; right: -100%; width: 100%; height: 2px; background: linear-gradient(270deg, transparent, #03a9f4); animation: animate3 1s linear infinite; animation-delay: .5s; } @keyframes animate3 { 0% { right: -100%; } 50% { right: 100%; } 100% { right: 100%; } } a span:nth-child(4) { bottom: -100%; left: 0; width: 2px; height: 100%; background: linear-gradient(360deg, transparent, #03a9f4); animation: animate4 1s linear infinite; animation-delay: .75s; } @keyframes animate4 { 0% { bottom: -100%; } 50% { bottom: 100%; } 100% { bottom: 100%; } } ``` 这个登录界面使用了CSS3的动画效果,通过伪元素和动画的组合实现了一个按钮的动态效果,非常炫酷

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值