【发布时间】:2013-10-25 09:06:40
【问题描述】:
我想为以下字段创建一个自定义复选框:
<label class="cmfchklabel"><input type="checkbox" id="cmf-2" name="cmf[2][value][]" value="true" checked>New Year\'s Eve</label>
该字段是通过插件填充的,因此我无法更改该基本标记。
我想出了如何在 webkit 浏览器中更新复选框的外观,但 Firefox 一直显示一个复选框,即使我设置了 -moz-appearance:none;。
如何在不更改基本标记的情况下使用 CSS 更新 Firefox 中复选框的外观?
作为参考,这是我当前用于复选框的 CSS:
input[type="checkbox"],input[type="checkbox"]:checked {
-moz-appearance:none;
-webkit-appearance: none;
appearance: none;
border:none;
outline: none;
}
input[type="checkbox"]:checked:before {
background:#177dc0;
}
input[type="checkbox"]:before {
content:'';
background:#361512;
display:inline-block;
height:11px;
width:11px;
margin-right:1px;
}
谢谢。
【问题讨论】:
标签: html css firefox checkbox mozilla