【本文效果抢先看】? 上滑查看完整代码
✨ 渐变背景与磨砂质感的完美碰撞
✨ 移动端优先的响应式布局方案
✨ 自带输入框动态交互的细节优化
✨ 一键复制即用的完整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;
}

優(yōu)網(wǎng)科技秉承"專(zhuān)業(yè)團(tuán)隊(duì)、品質(zhì)服務(wù)" 的經(jīng)營(yíng)理念,誠(chéng)信務(wù)實(shí)的服務(wù)了近萬(wàn)家客戶,成為眾多世界500強(qiáng)、集團(tuán)和上市公司的長(zhǎng)期合作伙伴!
優(yōu)網(wǎng)科技成立于2001年,擅長(zhǎng)網(wǎng)站建設(shè)、網(wǎng)站與各類(lèi)業(yè)務(wù)系統(tǒng)深度整合,致力于提供完善的企業(yè)互聯(lián)網(wǎng)解決方案。優(yōu)網(wǎng)科技提供PC端網(wǎng)站建設(shè)(品牌展示型、官方門(mén)戶型、營(yíng)銷(xiāo)商務(wù)型、電子商務(wù)型、信息門(mén)戶型、微信小程序定制開(kāi)發(fā)、移動(dòng)端應(yīng)用(手機(jī)站、APP開(kāi)發(fā))、微信定制開(kāi)發(fā)(微信官網(wǎng)、微信商城、企業(yè)微信)等一系列互聯(lián)網(wǎng)應(yīng)用服務(wù)。