پیشنمایش زنده
کد HTML
<section class="container">
<label>
<input name="check" type="checkbox" />
<span></span>
<p>N</p>
</label>
</section>
کد CSS
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.container label {
cursor: pointer;
position: relative;
width: 80px;
height: 80px;
display: flex;
justify-content: center;
align-items: center;
}
label input {
appearance: none;
}
label span {
width: 100%;
height: 100%;
position: absolute;
background: linear-gradient(#fff, #ebf5fc, #ebf5fc);
border-radius: 6px;
box-shadow: inset 0 5px 1px 0 rgba(0, 0, 0, 0.1),
0 5px 15px rgba(0, 0, 0, 0.1), 0 -5px 15px rgba(0, 0, 0, 0.15);
}
.container label span::before {
content: "";
position: absolute;
border-top: 1px solid #fff;
inset: 5px 3px;
filter: blur(5px);
}
.container label input:checked ~ span {
box-shadow: inset 0 -5px 0 0 rgba(0, 0, 0, 0.2),
0 2px 10px rgba(0, 0, 0, 0.75);
background: linear-gradient(#2b6b73, #31727a, #2b6b73);
}
label p {
position: relative;
z-index: 10;
font-size: 3rem;
color: #6d8e90;
}
.container label input:checked ~ p {
color: #fff;
filter: drop-shadow(0 0 5px #00ffe2) drop-shadow(0 0 8px #00ffe2)
drop-shadow(0 0 12px #00ffe2) drop-shadow(0 0 16px #00ffe2);
}