最新下载
24小时阅读排行榜
- 1 小黑盒加速器官方下载_小黑盒游戏加速器最新版
- 2 mc.js网页版在线玩 mc.js游戏世界入口
- 3 Edge浏览器收藏网页的快捷键
- 4 VSCode用户设置同步功能
- 5 联想ThinkPlus真无线和摩托罗拉VerveBuds哪款更耐用_联想与摩托罗拉蓝牙耳机综合对比
- 6 芒果发黑还能吃吗 芒果坏了如何辨别
- 7 如何为Laravel创建自定义命令_Artisan自定义命令行工具开发
- 8 vscode怎么用git比较分支差异_vscode比较两个git分支之间差异的方法
- 9 iPhone17Pro怎样查看存储空间_iPhone17Pro存储占用情况查看与清理方法
- 10 windows10如何设置文件夹背景颜色或图片_windows10文件夹背景自定义方法
- 11 Go语言:高效实现IP地址范围检查
- 12 edge浏览器启动时如何恢复上次的会话_Edge自动恢复标签页设置
- 13 php调用内存优化技巧_php调用垃圾回收机制优化
- 14 Go语言中获取Map元素数量的正确姿势
- 15 c++中静态多态和动态多态的实现_c++编译期与运行期多态机制对比
最新教程
-
- Node.js 教程
- 7460 2025-08-28
-
- CSS3 教程
- 1049656 2025-08-27
-
- Rust 教程
- 11833 2025-08-27
-
- Vue 教程
- 14071 2025-08-22
-
- PostgreSQL 教程
- 10825 2025-08-21
-
- Git 教程
- 5155 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表单输入框验证代码,当输入框聚焦时出现图标动画,还有验证邮箱地址格式是否正确等功能。

