【发布时间】:2021-10-01 01:38:10
【问题描述】:
我创建了一个带有自定义复选框的 div,我想通过自定义图像更改复选框图像。我已经完成了,但我无法更改图像的大小。请帮助我。
任何帮助将不胜感激。
<div class="left">
<input id="Option" type="checkbox">
<label class="checkbox" for="Option"> </label>
</div>
还有我用过的 CSS。
.checkbox {
display: inline-block;
cursor: pointer;
font-size: 13px; line-height:18px;
}
input[type=checkbox] {
display:none;
}
.checkbox:before {
content: "";
display: inline-block;
width: 25px;
height: 25px;
vertical-align: middle;
background-color: rgb(248,183,51);
color: #f3f3f3;
text-align: center;
}
input[type=checkbox]:checked + .checkbox:before {
content: url("images/Tick.png");
text-shadow: 1px 1px 1px rgba(0, 0, 0, .2);
font-size: 15px;
}
【问题讨论】: