这个问题可能看起来很愚蠢,但仍然如此。在复选框中,我需要创建绿色和红色区域,但我不知道如何做。下面是它应该如何工作的示例:
代码:
<label>
<input type="checkbox"> Subscribe
</label>
<label>
<input type="checkbox" checked> Subscribe
</label>
CSS:
input[type="checkbox"]{
appearance:none;
background:limegreen;
border:10px solid green;
width: 40px;
height: 25px;
border: 1px solid;
}
input[type="checkbox"]:checked{
background:white;
border-color:red;
}