最新下载
24小时阅读排行榜
- 1 PHP 中生成指定周几的周期性日期序列(如每周一、每周三等)
- 2 Jupyter Notebook 自动保存机制详解:无需手动保存也能安心下载
- 3 如何正确使用 :last-of-type 选择器实现“按类名选取最近子元素”
- 4 Go 中 quit 通道在二叉树遍历(Walk)中的作用详解
- 5 Go 中 quit 通道在二叉树遍历中的作用:优雅终止协程以实现高效同步
- 6 Python 实现带降级机制的缓存:网络不可靠时返回过期数据
- 7 如何在 Django 中正确使用 CKEditor 并保存富文本内容
- 8 JavaScript 表单事件绑定失败的常见原因及修复方案
- 9 如何正确使用 :last-of-type 选择器定位特定类的最后一个直接子元素
- 10 PHPMailer SMTP 配置在 OVH 服务器上的正确实践
- 11 如何让网格容器中的子元素显示渐变背景,而容器空白区域保持白色
- 12 Go语言中函数返回指针时的地址理解与常见误区
- 13 Go 中二叉树遍历的 quit 通道:如何优雅终止协程并避免资源泄漏
- 14 如何让异步调用代码更清晰易读
- 15 如何优化 WooCommerce 货币符号 DOM 结构以减少元素数量
最新教程
-
- Node.js 教程
- 16098 2025-08-28
-
- CSS3 教程
- 1546496 2025-08-27
-
- Rust 教程
- 23239 2025-08-27
-
- Vue 教程
- 25709 2025-08-22
-
- PostgreSQL 教程
- 22192 2025-08-21
-
- Git 教程
- 9177 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表单输入框验证代码,当输入框聚焦时出现图标动画,还有验证邮箱地址格式是否正确等功能。
