效果展示:
open:
close:
代码实现:
<input type="checkbox" name="switch" id="switch">
<label for="switch"></label>
/* 精确找到input类型 */
input[type="checkbox"] {
width: 0;
height: 0;
visibility: hidden;
}
label {
display: block;
width: 500px;
height: 150px;
background-color: #477a85;