【本文效果抢先看】? 上滑查看完整代码
✨ 渐变背景与磨砂质感的完美碰撞
✨ 移动端优先的响应式布局方案
✨ 自带输入框动态交互的细节优化
✨ 一键复制即用的完整CSS代码
效果
HTML
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>毛玻璃登录界面</title>
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<div class="glass">
<form class="login-form">
<h2>欢迎登录</h2>
<div class="input-group">
<input type="text" placeholder="用户名" required>
</div>
<div class="input-group">
<input type="password" placeholder="密码" required>
</div>
<button type="submit">立即登录</button>
<div class="links">
<a href="#">注册账号</a>
<a href="#">忘记密码?</a>
</div>
</form>
</div>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
min-height: 100vh;
background:linear-gradient(45deg, #ff6b6b, #4ecdc4);
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.glass{
background:rgba(255, 255, 255, 0.1);
backdrop-filter:blur(10px);
-webkit-backdrop-filter:blur(10px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px 0 rgba(52, 57, 120, 0.37);
padding: 40px;
width: 400px;
position: relative;
}
.login-form{
color: white;
}
h2{
text-align: center;
margin-bottom: 30px;
font-size: 2em;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.input-group{
margin-bottom: 25px;
}
input{
width: 100%;
padding: 15px;
background:rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 8px;
color: white;
font-size: 16px;
transition: all 0.3s;
}
input:focus{
outline: none;
background:rgba(255, 255, 255, 0.2);
border-color:rgba(255, 255, 255, 0.5);
}
input::placeholder{
color:rgba(255, 255, 255, 0.7);
}
button{
width: 100%;
padding: 15px;
background:linear-gradient(45deg, #ff6b6b, #ff8e8e);
border: none;
border-radius: 8px;
color: white;
font-size: 16px;
cursor: pointer;
transition: all 0.3s;
}
button:hover{
transform:translateY(-2px);
box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}
.links{
margin-top: 20px;
display: flex;
justify-content: space-between;
}
a{
color:rgba(255, 255, 255, 0.8);
text-decoration: none;
font-size: 14px;
}
a:hover{
color: white;
}

优网科技秉承"专业团队、品质服务" 的经营理念,诚信务实的服务了近万家客户,成为众多世界500强、集团和上市公司的长期合作伙伴!
优网科技成立于2001年,擅长网站建设、网站与各类业务系统深度整合,致力于提供完善的企业互联网解决方案。优网科技提供PC端网站建设(品牌展示型、官方门户型、营销商务型、电子商务型、信息门户型、DIY体验、720全景展厅及3D虚拟仿真)、移动端应用(手机站、APP开发)、微信定制开发(微信官网、微信商城、企业微信)、微信小程序定制开发等一系列互联网应用服务。