<style>
input.checkbox
{
width:300px;
height:300px;
margin:0px 0 0 0px;
}
</style>
<body>
<input type="checkbox" class="checkbox"/>
我想增加复选框大小,但此代码可以在 Internet Explorer 中正常工作,但不能在 Safari 中工作。
input[type=checkbox] {
-webkit-transform: scale(3,3);
}
您必须使用自定义 webkit css 属性来缩放它们:
input.checkbox {
-webkit-transform: scale(1.3,1.3);
}
Tutorialspoint 有更好的答案:https://www.tutorialspoint.com/how-to-set-checkbox-size-in-html-css
input[type=checkbox] {
-webkit-appearance: none;
display: inline-block;
width: 40px;
height: 40px;
background-color: red;
border-radius: 5px;
border: 3px solid lightgray;
margin-right: 10px;
}
input[type=checkbox]:checked {
background-color: lightgreen;
}