css实现checkbox打钩横线划掉效果代码

代码语言:html

所属分类:表单美化

代码描述:css实现checkbox打钩横线划掉效果代码

代码标签: 打钩 横线 划掉 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
<style>
* {
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
:root {
	--bg: #e3e4e8;
	--checkBg: #ffffff;
	--checkBorder: #c7cad1;
	--fg: #17181c;
	--fgDim: #5c6270;
	--primary: #255ff4;
	--dur: 0.6s;
	font-size: calc(16px + (24 - 16) * (100vw - 320px) / (1280 - 320));
}
body, input {
	color: var(--fg);
	font: 1em/1.5 system-ui, -apple-system, sans-serif;
}
body {
	background: var(--bg);
	display: grid;
	height: 100vh;
	place-items: center;
}
label, input[type=checkbox] {
	cursor: pointer;
}
label {
	display: inline-flex;
	align-items: center;
	margin-bottom: 0.75em;
	position: relative;
	-webkit-tap-highlight-color: transparent;
}
input[type=checkbox], input[type=checkbox]:before, input[type=checkbox]:after {
	width: 1.5rem;
	height: 1.5rem;
}
input[type=checkbox], input[type=checkbox]:before {
	background: var(--checkBg);
	border-radius: 0.2em.........完整代码请登录后点击上方下载按钮下载查看

网友评论0