radio checkbox点击美化动画效果
代码语言:html
所属分类:表单美化
代码描述:radio checkbox点击美化动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Hind:wght@400;700&display=swap'>
<style>
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--bg: #e3e4e8;
--fg: #17181c;
--inputBg: #ffffff;
--inputBgDown: #e3e4e8;
--inputBorder: #c7cad1;
--inputBorderDown: #c7cad1;
--primary: #255ff4;
--primaryDown: #5583f6;
--duration: 0.5s;
font-size: calc(20px + (30 - 20)*(100vw - 320px)/(1280 - 320));
}
body, input {
font: 1em/1.5 Hind, sans-serif;
}
body, label {
display: flex;
}
body {
background: var(--bg);
color: var(--fg);
height: 100vh;
}
form {
margin: auto;
}
label, input {
cursor: pointer;
}
input {
margin-right: 0.5em;
width: 1.5em;
height: 1.5em;
-webkit-appearance: none;
appearance: none;
}
input:focus {
outline: transparent;
}
input[type=checkbox], input[type=checkbox]:after, input[type=radio] {
transition: all 0.1s linear;
}
input[type=checkbox] {
background: var(--inputBg);
border-radius: 0.25em;
box-shadow: 0 0 0 0.1em var(--inputBorder) inset;
}
input[type=checkbox]:after {
color: #255ff4;
content: "\2713";
display: block;
font-size: 1.5em;
line-height: 1;
text-align: center;
transform: scale(0);
transform-origin: 50% 67%;
width: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0