input[type=“checkbox“] 美化CheckBox

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			@keyframes cb_after {
				from {
					opacity: 0;
					height: 0;
				}

				to {
					opacity: 1;
					height: 50px;
				}
			}

			@keyframes cb_before {
				from {
					opacity: 0;
					height: 0;
				}

				to {
					opacity: 1;
					height: 130px;
				}
			}

			body {
				width: 100%;
				height: 100%;
			}

			.checkbox-warp {
				width: 100px;
				height: 100px;
				margin: 100px auto;
			}

			.checkbox-warp input[type="checkbox"] {
				display: none;
			}

			.checkbox-warp label {
				position: relative;
				display: block;
				width: 100%;
				height: 100%;
				border: 15px solid #000000;
			}

			.checkbox-warp label::after,
			.checkbox-warp label::before {
				position: absolute;
				content: "";
				display: block;
				width: 20px;
				background-color: #36AB19;
				border-radius: 5px;
				transform-origin: left top;
			}

			.checkbox-warp label::after {
				left: 6px;
				top: 60px;
				transform: rotate(-55deg);
			}

			.checkbox-warp label::before {
				left: 50px;
				top: 90px;
				box-shadow: 0 0 0 5px #FFFFFF;
				transform: rotate(-145deg);
			}

			.checkbox-warp input[type="checkbox"]:checked+label {
				border-color: #36AB19;
			}

			.checkbox-warp input[type="checkbox"]:checked+label::before {
				animation: cb_before .2s .2s forwards linear;
			}

			.checkbox-warp input[type="checkbox"]:checked+label::after {
				animation: cb_after .2s forwards linear;
			}
		</style>
	</head>
	<body>
		<div class="checkbox-warp">
			<input type="checkbox" id="check-box" />
			<label for="check-box"></label>
		</div>
	</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,这里是一个简单的样式设计,你可以根据需要进行修改: ``` <style> body { background-color: #f2f2f2; } .title { text-align: center; font-size: 24px; margin-bottom: 20px; } form { width: 400px; margin: 0 auto; padding: 20px; background-color: #fff; border-radius: 5px; box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2); } input { display: block; width: 100%; padding: 10px; margin-bottom: 10px; border: none; border-radius: 5px; box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.1); } input[type="submit"] { background-color: #ff6700; color: #fff; font-size: 18px; font-weight: bold; cursor: pointer; } input[type="submit"]:hover { background-color: #ff8c00; } #reader-me { margin-right: 10px; vertical-align: middle; } #reader-me + label { display: inline-block; vertical-align: middle; } </style> <div> <h3 class="title">注册</h3> <form method="post"> <div> <input type="email" v-model="email" id="email" placeholder="请输入邮箱账号"> </div> <div> <input type="password" v-model="password" id="password" placeholder="设置密码"> </div> <div> <input type="password" v-model="passwordRepeat" id="passwordRepeat" placeholder="确认密码"> </div> <div> <input type="text" v-model="tel" id="tel" placeholder="请输入手机号"> </div> <div> <input id="reader-me" type="checkbox" v-model="checked"> <label for="reader-me">点击表示您同意商城《服务协议》</label> </div> <div> <input type="submit" name="" :disabled="!checked" @click="mr_verify" value="注册"> </div> </form> </div> ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值