Hi,
When generating a checkbox field with MVC Razor, as follows:
@Html.EditorFor(model => model.IsHappy)
It inserts the class form-control to the generated input element, which is in this case a checkbox.
What happens is, the element becomes huge to take up free space:

I found it that what's causing this issue is the width=100% setting of .form-control, and when I add the following underneath the .form-control classes in the _bootstrap.css_ file, issue is solved.
.form-control is only meant for use on <textarea>s, <select>s, and textual <input>s.
Use the .checkbox class for checkboxes (see the docs for details on usage).
I guess this is something the ASP.NET MVC Razor engine team missed out.
Thanks and sorry for bothering!
I did not understand what is the solution and how to implement it. Please, explain like I have 6yo because I am not a CSS expert. Thanks.
The solution was to just to not use .form-control class for checkboxes
Most helpful comment
.form-controlis only meant for use on<textarea>s,<select>s, and textual<input>s.Use the
.checkboxclass for checkboxes (see the docs for details on usage).