Safari 中的复选框大小?

问题描述 投票:0回答:3
<style>  
input.checkbox  
{  
    width:300px;  
    height:300px;  
    margin:0px 0 0 0px;  
}  
</style>  
<body>  
<input type="checkbox" class="checkbox"/>

我想增加复选框大小,但此代码可以在 Internet Explorer 中正常工作,但不能在 Safari 中工作。

css safari checkbox
3个回答
23
投票
input[type=checkbox] {
    -webkit-transform: scale(3,3);
}

0
投票

您必须使用自定义 webkit css 属性来缩放它们:

input.checkbox {
    -webkit-transform: scale(1.3,1.3);
}

0
投票

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;
      }
© www.soinside.com 2019 - 2024. All rights reserved.