Input checkbox 添加样式背景


<style type="text/css">
.chk_1 {
width: 20px;
height: 20px;
position: absolute;
top: 15px;
left: 10px;
}
.chk_1 + label {
background: #ccc;
width: 20px;
height: 20px;
display: inline-block;
position: absolute;
top: 17px;
left: 12px;
}
.chk_1:checked + label {
background:red;
}
</style>
</head>

<body>
<input type="checkbox" id="checkbox_a1" class="chk_1">
<label for="checkbox_a1"></label>
</body>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM