我想显示复选框作为切换按钮。但我无法将自定义图片应用于CCS - 仍然绘制复选框。如何完成这项任务?复选框的自定义图片?
我的CSS:
input[type=checkbox]#settingsbutton {
border-style: none;
background-color: transparent;
width: 42px;
height: 40px;
display: block;
}
input[type=checkbox].button-settings {
background-image: url("images/button-settings-normal.png");
}
input[type=checkbox].button-settings:active {
background-image: url("images/button-settings-normal.png");
}
input[type=checkbox].button-settings:hover {
background-image: url("images/button-settings-hover.png");
}
input[type=checkbox].button-settings:active {
background-image: url("images/button-settings-pressed.png");
}
我的HTML:
<body>
<input type="checkbox" id="settingsbutton" class="button-settings"/>
</body>
的联系是非常有用的,但我不明白为什么你使用'显示:上的复选框none'?如果没有显示,你不能点击它?您的链接建议将不透明度设置为零。 – Mikaveli 2013-06-03 14:33:58
您可以点击将激活复选框的标签 – Prodikl 2014-01-19 09:02:12