Html 使用 CSS 更改复选框大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25549661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:35:29  来源:igfitidea点击:

Check box size change with CSS

htmlcssmobile

提问by Klapsius

How can I change check box sizes (globaly) without class and id? Is it possible to do this in a way different from:

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

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

回答by Charleshaa

inputfields can be styled as you wish. So instead of zoom, you could have

input字段可以根据需要设置样式。所以,而不是缩放,你可以有

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

EDIT:

编辑:

You would have to add extra rules like this:

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

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

Check this fiddle http://jsfiddle.net/p36tqqyq/1/

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

回答by Shreejibawa

You might want to do this.

您可能想要这样做。

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

回答by Genish Parvadia

Try this

尝试这个

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