You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bootstrap 4 form-check alignment with horizontal label #24844
A horizontal label and control vertical alighment issue can be confirmed here as well. (The "Radios" row)
I think we should not solve this by CSS because CSS will be more complex and more difficult to understand the responsive behaveor. When resize a window to mobile size on your codepen, you can see a slightly larger spacing between the label and first checkbox.
To resolve this issue, just add pt-{breakpoint}-0 to .col-form-label (or .col-form-legend).
The mobile size spacing can be easily solved with a media query (I edited my pen)
My first idea was yours, but If you remove the label's top padding the label is too close from the previous element, it breaks the vertical alignment: https://codepen.io/migli/pen/mqxQjo
I also noticed that the example code was a bit inconsistent.
The main label for radio is <legend class="col-form-legend col-sm-2">Radios</legend> while the checkbox's main label is <div class="col-sm-2">Checkbox</div>
The regularity of the alignment isn't my concern I think, and I don't imagine it's the concern of anyone else reporting this issue. The more important part is that this one label matches it's inputs.
Activity
ysds commentedon Nov 22, 2017
A horizontal label and control vertical alighment issue can be confirmed here as well. (The "Radios" row)
I think we should not solve this by CSS because CSS will be more complex and more difficult to understand the responsive behaveor. When resize a window to mobile size on your codepen, you can see a slightly larger spacing between the label and first checkbox.
To resolve this issue, just add
pt-{breakpoint}-0to.col-form-label(or.col-form-legend).migliori commentedon Nov 22, 2017
The mobile size spacing can be easily solved with a media query (I edited my pen)
My first idea was yours, but If you remove the label's top padding the label is too close from the previous element, it breaks the vertical alignment: https://codepen.io/migli/pen/mqxQjo
I also noticed that the example code was a bit inconsistent.
The main label for radio is
<legend class="col-form-legend col-sm-2">Radios</legend>while the checkbox's main label is<div class="col-sm-2">Checkbox</div>mdo commentedon Nov 27, 2017
Perhaps we instead advise folks to simply not use that class on form groups with radios and checks? https://codepen.io/anon/pen/BmORRj
migliori commentedon Nov 28, 2017
it's a possibility, but it breaks the regularity of the vertical alignment of labels.
mdo commentedon Nov 28, 2017
The regularity of the alignment isn't my concern I think, and I don't imagine it's the concern of anyone else reporting this issue. The more important part is that this one label matches it's inputs.
migliori commentedon Nov 28, 2017
it's up to you
Override padding on radio input label
Override padding on radio input label (#24899)
chore: sync with twbs (#1)
Remove .col-form-legend in favor of .col-form-label (#24932)
Sync v-4dev with twbs (#4)
merge after v4-beta3 release