最新下载
Vue记事本添加删除特效
24小时阅读排行榜
- 1 fastapi 如何让 Query 参数支持单值与 List 同时兼容
- 2 Linux iptables 规则匹配顺序解析
- 3 Laravel如何实现软删除功能?(SoftDeletes代码示例)
- 4 datetime 如何处理 ambiguous 时间(如夏令时结束时的重复小时)
- 5 Python 为什么不需要手动释放内存?
- 6 Python 为什么一切皆对象
- 7 Python 生成器表达式的使用边界
- 8 HAProxy负载均衡失效:解决HTTP持久连接导致的后端粘连问题
- 9 systemd timer 延迟几分钟甚至几小时的 OnCalendar 精度优化
- 10 Python 惰性计算在工程中的应用
- 11 如何在输入特定数字时动态改变页面样式(如背景色)
- 12 Python 装饰器叠加时的执行顺序
- 13 如何防止表单在 JavaScript 确认逻辑未通过时重复提交
- 14 SQL 如何避免幻读(Phantom Read)在不同隔离级别下的表现
- 15 html5滤镜怎样模拟景深_html5景深滤镜css技巧【技巧】
最新教程
-
- Node.js 教程
- 16285 2025-08-28
-
- CSS3 教程
- 1546933 2025-08-27
-
- Rust 教程
- 23413 2025-08-27
-
- Vue 教程
- 25856 2025-08-22
-
- PostgreSQL 教程
- 22351 2025-08-21
-
- Git 教程
- 9310 2025-08-21
html,
body {
background-color: #F4F4F4;
display: flex;
width: 100%;
height: 100%;
align-items: center;
font-family: "Work Sans", sans-serif;
justify-content: center;
}
.exp-container {
width: 100%;
padding: 30px;
box-sizing: border-box;
max-width: 600px;
}
.exp {
display: flex;
flex-direction: column-reverse;
width: 100%;
margin-bottom: 30px;
position: relative;
flex-wrap: wrap;
}
.exp__label {
transition: 0.3s;
margin-bottom: 5px;
}
.exp__label:before {
content: attr(data-icon);
font-weight: normal;
font-family: "Ionicons";
font-size: 24px;
position: absolute;
left: 0;
transform: rotateY(90deg);
bottom: 0;
height: 52px;
background: transparent;
color: #000;
transform-origin: left;
display: flex;
align-items: center;
justify-content: center;
transition: color .3s 0s ease, transform .3s 0s ease;
width: 42px;
}
.exp__input {
border: 1px solid #ddd;
padding: 0 10px;
width: 100%;
height: 52px;
transition: 0.3s;
font-weight: normal;
box-sizing: border-box;
font-family: "Work Sans", sans-serif;
outline: none;
}
.exp__input:focus {
padding-left: 42px;
border-color: #bbb;
}
.exp__input:focus + label:before {
transform: rotateY(0deg);
}
.exp__input:valid {
padding-left: 42px;
border-color: green;
}
.exp__input:valid + label {
color: green;
}
非常简单的一款带动画效果的CSS3表单输入框验证代码,当输入框聚焦时出现图标动画,还有验证邮箱地址格式是否正确等功能。
