复选框标签重叠复选框 - Bootstrap3

时间:2015-02-26 14:56:20

标签: css twitter-bootstrap checkbox

我正在使用bootstrap 3&问题是复选框的标签与文本重叠。我尝试过一些东西但是没有用,所以如果有人可以提供帮助,我会非常感激。这就是代码的样子,表单的类是form-horizo​​ntal

<div class="checkbox">
    <label class="checkbox-inline no_indent">I have read and agree with    privacy and disclosure policy.
    <input name="Terms" id="Terms" type="checkbox" ></label>
</div>

This is how it looks

3 个答案:

答案 0 :(得分:1)

应该首先使用Bootstrap,<input>,然后是文本。 http://jsfiddle.net/sqax02ah/

<div class="checkbox">
    <label class="checkbox-inline no_indent">
        <input name="Terms" id="Terms" type="checkbox">
        I have read and agree with privacy and disclosure policy.
    </label>
</div>

如果确实需要,最后会出现一个复选框,您可以按照其他答案进行操作。

答案 1 :(得分:0)

在Bootstrap中,样式希望首先选中thecheckbox,然后是文本,因此设置了margin-left: -20px。对于您的代码段,您需要添加自定义样式。

.radio input[type=radio], .radio-inline input[type=radio], .checkbox input[type=checkbox], .checkbox-inline input[type=checkbox] {
    margin-right: -20px;
    margin-left: 0;
}

Fiddle

答案 2 :(得分:0)

尝试对.checkbox类使用display: inline-block,它应该有所帮助。或者通过保证金margin-left: 20px;

更改头寸