HTML/CSS : how can I make the checkboxes grow when zooming in and shrink when zooming out?

标签 html css checkbox

我有这个简单的测试代码:

<html>
<head>
<style type="text/css">
    ul{
        float:left;
        margin:0;
        list-style:none;
        padding:0;
      }
</style>
    </head>
<body>
    <ul>
       <li><input type="checkbox" id="c1" class="checkBox">a</li>
        <li><input type="checkbox" id="c2" class="checkBox"/>b</li>
        <li><input type="checkbox" id="c3" class="checkBox"/>c</li>
    </ul>
    <ul>
        <li><input type="checkbox" id="c4" class="checkBox"/>d</li>
        <li><input type="checkbox" id="c5" class="checkBox"/>e</li>
           <li><input type="checkbox" id="c6" class="checkBox" />f</li>
    </ul>
    <ul>
        <li><input type="checkbox" id="c7" class="checkBox"/>g</li>
        <li><input type="checkbox" id="c8" class="checkBox"/>h</li>
        <li><input type="checkbox" id="c9" class="checkBox"/>i</li>
    </ul>
</body>
</html>

结果如下:

enter image description here

但是如果我缩小文本变小但复选框保持不变

enter image description here

如果我放大,文本会变大,但复选框保持不变

enter image description here

是否可以让复选框也改变它们的大小?例如与标签的大小成比例? 提前致谢

最佳答案

jsFiddle DEMO

使用 CSS3 缩放列表以及浏览器呈现的复选框!

.extraLarge ul {
  -moz-transform: scale(1.50);
  -webkit-transform: scale(1.50);
  -o-transform: scale(1.50);
  transform: scale(1.50);
  padding: 10px;
}

关于HTML/CSS : how can I make the checkboxes grow when zooming in and shrink when zooming out?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13778963/

相关文章:

html - 我们能否在媒体查询的所有屏幕分辨率中只使用任何属性的一个值?

javascript - 带有 Ionic 的 MaterializeCSS 下拉菜单不起作用

javascript - 如何在背景图片上添加文字

c++ - 以编程方式(C++)为所有 QProgressBars 的 Qt 样式表

css - 媒体查询在 Internet Explorer 10 中不起作用

html - 为什么我的 SVG 图标在使用 grunt svg sprite 时被剪掉了?

javascript - 提交表单后运行函数

python - 如何使用 python 隐藏 QTableView 中的复选框?

javascript - 如何为未知数量的复选框实现全选按钮

qt4 - QCheckbox/QRadioButton 换行 Qt4.6.0