Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Bootstrap Basics Building Forms With Bootstrap Custom Form Controls for Cross-Browser Consistency

Miguel Piñas
Miguel Piñas
4,940 Points

form-check instead of form-group

I wonder why, when adding the checkbox control, we don't use the form-group class for the parent div instead of the form-check class.

Is there any difference?

          <div class="form-check">
              <label class="custom-control custom-checkbox">
                <input type="checkbox" class="custom-control-input">
                <span class="custom-control-indicator"></span>
                <span class="custom-control-description">Javascript</span>
              </label>
          </div>

1 Answer

Steven Parker
Steven Parker
229,968 Points

The "form-check" class is a specialized version of "form-group" designed to give checkboxes a consistent appearance across different browsers. The difference may not be visible on any one particular browser, or when the form-check subclasses are not used.