【发布时间】:2020-12-19 03:20:48
【问题描述】:
我想知道如何为复选框着色,我必须在不使用php的情况下创建几种不同的颜色,我们如何处理不同id的复选框?内容:'✔'不显示..感谢您的帮助
input[type='checkbox'] {
color:orange;
outline: 1px solid orange;
width: 14px !important;
height: 14px !important;
margin: 5px;
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
content: '';
box-shadow: none;
font-size: 0.8em;
text-align: center;
line-height: 1em;
}
input[type="checkbox"]:not(:checked) + label:after,
input[type="checkbox"]:checked + label:after {
content: '✔';
color: orange;
}
<input type="checkbox" id="orange" value="" checked="checked">
<input type="checkbox" id="purple" value="">
<input type="checkbox" id="pink" value="">
com/h533A.jpg
【问题讨论】:
-
会
-webkit-appearance: none;-moz-appearance: none;-o-appearance: none;隐藏它吗? -
这能回答你的问题吗? How to style a checkbox using CSS