Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用CSS更改复选框大小_Html_Css_Mobile - Fatal编程技术网

Html 使用CSS更改复选框大小

Html 使用CSS更改复选框大小,html,css,mobile,Html,Css,Mobile,在没有类和id的情况下,如何更改复选框大小(全局)?是否有可能以不同于以下方式进行此操作: input[type=checkbox] { zoom: 1.5; } 你可能想这样做 input[type=checkbox] { -ms-transform: scale(2); /* IE */ -moz-transform: scale(2); /* FF */ -webkit-transform: scale(2); /* Safari and Chrome */ -o-tr

在没有类和id的情况下,如何更改复选框大小(全局)?是否有可能以不同于以下方式进行此操作:

input[type=checkbox] {
    zoom: 1.5;
}

你可能想这样做

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;
}

输入
字段可以根据需要设置样式。因此,您可以使用

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;
}
检查这把小提琴试试这个

<input type="checkbox" style="zoom:1.5;" />
/* The value 1.5 i.e., the size of checkbox will be increased by 0.5% */

/*值1.5,即复选框的大小将增加0.5%*/

为什么这种方法不适合您?这是事实。在应用css之前,应该先在css中重置该值,否则其他浏览器将覆盖该值。我可以确认这是可行的,但是我更喜欢使用比例值,因为它会随浏览器大小而缩放。在移动设备上,30px看起来与刻度盘大小不同。其次,每个屏幕的密度各不相同,使得低rez上的30px比刻度尺寸大得多。因此,这取决于您尝试完成的内容:)是的,相同,复选框仍然显示相同的大小。我已签入
FireFox
v.31并更改
宽度值和
高度值,仍然相同这很有趣,但如果没有复选框,用户如何知道复选框是否已被选中?未经检查就成为一个神秘的肉形元素。@b_dubb您可以使用伪类
input[type=“checkbox”]:checked
根据需要对其进行样式设置。这怎么不是公认的答案?解决方案在mac的chrome上有问题。复选框不清楚您可能想这样做,但可能不想这样做。它是超级像素化的,大多数应用程序都不能接受。谢谢。现在不需要使用特定于浏览器的选项。不适用于firefox