使用CSS复制框大小更改[重复]

问题描述 投票:33回答:3

这个问题在这里已有答案:

如何在没有class和id的情况下更改复选框大小(全局)?是否有可能以这样的方式做到这一点:

input[type=checkbox] {
    zoom: 1.5;
}
html css mobile
3个回答
61
投票

input字段可以根据需要设计。因此,您可以拥有,而不是缩放

input[type="checkbox"]{
  width: 30px; /*Desired width*/
  height: 30px; /*Desired height*/
}

编辑:

你必须添加这样的额外规则:

input[type="checkbox"]{
  width: 30px; /*Desired width*/
  height: 30px; /*Desired height*/
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

检查这个小提琴http://jsfiddle.net/p36tqqyq/1/


26
投票

你可能想要这样做。

input[type=checkbox] {

 -ms-transform: scale(2); /* IE */
 -moz-transform: scale(2); /* FF */
 -webkit-transform: scale(2); /* Safari and Chrome */
 -o-transform: scale(2); /* Opera */
  padding: 10px;
}

10
投票

试试这个

<input type="checkbox" style="zoom:1.5;" />
/* The value 1.5 i.e., the size of checkbox will be increased by 0.5% */
© www.soinside.com 2019 - 2024. All rights reserved.