选择框checkbox选择与反选美化动画效果
代码语言:html
所属分类:表单美化
代码描述:通过css的设置,让原生的checkbox样式 变得更加美丽,动态交互效果跟人性化
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Varela+Round&display=swap'>
<style>
#checklist {
--background: #ffffff;
--text: #414856;
--check: #4F29F0;
--disabled: #C3C8DE;
--width: 100px;
--height: 140px;
--border-radius: 10px;
background: var(--background);
width: var(--width);
height: var(--height);
border-radius: var(--border-radius);
position: relative;
box-shadow: 0 10px 30px rgba(65, 72, 86, 0.05);
padding: 30px 45px;
display: grid;
grid-template-columns: 30px auto;
-webkit-box-align: center;
align-items: center;
}
#checklist label {
color: var(--text);
position: relative;
cursor: pointer;
display: grid;
-webkit-box-align: center;
align-items: center;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
-webkit-transition: color .3s ease;
transition: color .3s ease;
}
#checklist label::before {
position: absolute;
content: "";
height: 2px;
width: 8px;
left: -27px;
background: var(--check);
border-radius: 2px;
-webkit-transition: background .3s ease;
transition: background .3s ease;
}
#checklist label:after {
position: absolute;
cont.........完整代码请登录后点击上方下载按钮下载查看
网友评论0