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