加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
neumorphism-checkboxes.html 2.39 KB
一键复制 编辑 原始数据 按行查看 历史
网络大猩猩 提交于 2023-09-20 17:04 . 虚拟风按钮
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>虚拟风按钮</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<style>
ul {
width: 310px;
background: #ebf5fc;
border-radius: 10px;
padding: 10px;
box-shadow: -2px -2px 5px white, 3px 3px 5px rgba(0, 0, 0, 0.1);
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin: 50px auto;
}
ul li {
position: relative;
list-style: none;
text-align: center;
margin: 15px;
}
label .icon-box .fa {
font-size: 30px;
color: #6a9bd8;
}
.icon-box {
width: 60px;
height: 60px;
background: #ebf5fc;
display: flex;
justify-content: center;
align-items: center;
box-shadow: -2px -2px 5px white, 3px 3px 5px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
label {
position: relative;
cursor: pointer;
}
input[type="checkbox"] {
position: absolute;
opacity: 0;
}
input:checked~.icon-box {
box-shadow: inset -2px -2px 5px white, inset 3px 3px 5px rgba(0, 0, 0, 0.1);
}
input:checked~.icon-box .fa {
transform: scale(0.95);
}
</style>
</head>
<body>
<ul>
<li>
<label>
<input type="checkbox" checked="">
<div class="icon-box">
<i class="fa fa-home"></i>
</div>
</label>
</li>
<li>
<label>
<input type="checkbox">
<div class="icon-box">
<i class="fa fa-phone"></i>
</div>
</label>
</li>
<li>
<label>
<input type="checkbox">
<div class="icon-box">
<i class="fa fa-plane"></i>
</div>
</label>
</li>
<li>
<label>
<input type="checkbox">
<div class="icon-box">
<i class="fa fa-snowflake-o"></i>
</div>
</label>
</li>
<li>
<label>
<input type="checkbox">
<div class="icon-box">
<i class="fa fa-battery-full"></i>
</div>
</label>
</li>
<li>
<label>
<input type="checkbox">
<div class="icon-box">
<i class="fa fa-code"></i>
</div>
</label>
</li>
</ul>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化