DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Extra checkbox class on checkboxes in Bootstrap 3 #78

Closed JustinPierce closed 10 years ago

JustinPierce commented 10 years ago

The .Checkbox() method currently renders something similar to the following HTML:

<div class="checkbox">
    <label class="checkbox">
        <input type="checkbox" ... />
        Label Text
</div>

The problem is that the internal label should no longer have the checkbox class in Bootstrap 3. The additional checkbox class on the label causes the checkbox to have an extra 20px of padding between the input and the label.

DmitryEfimenko commented 10 years ago

It seems I'm unable to reproduce it. Could you please show exactly what you BMVC code you have in place?

JustinPierce commented 10 years ago

The following code produces the described behavior:

@(Html.Bootstrap()
    .CheckBox("theCheckBox")
    .Label()
    .LabelText("This is a check box"))

However, I've just found that using a FormGroup() instead of a bare check box does produce the correct markup. Of course, it also introduces the margins associated with a form-group.

DmitryEfimenko commented 10 years ago

This is fixed.