我如何使一个宽度&高度为16px? [英] How can I make a checkbox with a Width & Height of 16px?

查看:115
本文介绍了我如何使一个宽度&高度为16px?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个宽度为 16px 和高度 16px 的大型复选框。我不想使用JavaScript插件。

解决方案

您可以使用外观属性禁用默认复选框外观css和之后的风格任何你喜欢的边界,背景图像等方式:

  -webkit-appearance:none; 
-moz-appearance:none;
-o-appearance:none;

要悬停和检查状态,请使用:hover,:checked和:hover:checked pseudoclasses。 / p>

另一种方法是使用 transform 属性将其放大:

  -webkit-transform:scale(1.6,1.6); 
-moz-transform:scale(1.6,1.6);
-o-transform:scale(1.6,1.6);


I want to have a large checkbox with a width of 16px and a height of 16px. I don't want to have to use a JavaScript plugin. Can this be done with modern CSS?

解决方案

You can disable default checkbox appearance with appearance property in css and after that style it any way you like with borders, background-images and etc:

-webkit-appearance: none; 
-moz-appearance: none; 
-o-appearance: none;

To style hover and checked statuses use: :hover, :checked and :hover:checked pseudoclasses.

Another way is to use transform property to enlarge it:

-webkit-transform: scale(1.6,1.6);
-moz-transform: scale(1.6,1.6);
-o-transform: scale(1.6,1.6);

这篇关于我如何使一个宽度&高度为16px?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆