html - 增加复选框大小

标签 html css twitter-bootstrap

<分区>

如何增加复选框的宽度和高度?我尝试根据其他示例增加 .list-group input[type="checkbox"] + label:before 内的宽度和高度,但框的大小没有改变。

<ul class="list-group ml-3 mr-3 mt-1 " style="background-color:pink; height:auto">

    <li class="list-group-item d-flex p-0 border-0 ">
        <input style="background-color:yellow" class="" type="checkbox" id="CheckBox1" />
        <label style="font-size: 15px;"class="list-group-item w-100 p-0 border-0" for="CheckBox1">Caption asdsad asdasd </label>
    </li>

</ul>
/* Hide the browser's default checkbox */
.list-group input[type="checkbox"] {
    display: none;
}       

.list-group input[type="checkbox"] + label:before {
    content: "\2714";
    border: 0.1em solid #000;
    margin-right: 10px;
    color: transparent;
    width: 10px; // this is not working
    height: 20px; // this is not working
}

最佳答案

display: inline-block; 添加到 .list-group input[type="checkbox"] + label:before 中。

关于html - 增加复选框大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58573595/

相关文章:

jquery - 如何制作 Bootstrap 版本 2 选项卡下拉列表?

html - 带背景颜色的 Bootstrap 全宽侧边栏

ipad - 在 UIWebView 中运行 HTML5/CSS3

html - &lt;header&gt; 是语义标签还是结构标签

javascript - -moz-calc crossbrowser(polyfills?钩子(Hook)?)

html - child 忽略 parent 填充

html - 消除 HTML 中的额外高度

html - 谷歌浏览器缺少右双边框

css - 使输入字段透明

javascript - Jquery 和 Bootstrap 在 Firefox 中不工作