Bootstrap: Vertical alignment of radio/checkbox broken

Created on 3 Dec 2018  Â·  7Comments  Â·  Source: twbs/bootstrap

Bug reports must include:

Even in the default theme it is visible that the radio/checkbox controls are slightly located upwards compared to the label text. It becomes more apparent if you use a custom theme.

confirmed css v4 v5

All 7 comments

Confirmed, just note that v4.0 is quite old. Also happens with Firefox on Windows 10 for me.

Current v4-dev live preview https://twbs-bootstrap4.netlify.com/docs/4.1/components/forms/#default-stacked

@twbs/css-review: using margin-top: .5rem fixes the issue for me, but I'm not sure about other OS'es.

Chrome on windows:

Chrome on mac:

The height and width of the checkbox on windows is 13px, on mac it's 14px. I don't know if there is a way to create a solution for all OS'es 🤔

@MartijnCuppens: maybe fix it with JavaScript? ¯_(ツ)_/¯

https://stackoverflow.com/questions/306924/checkbox-size-in-html-css
@MartijnCuppens Above a link to SO with some approaches. Don't think any of them are without issues though, but if it points into the right direction it's worth to check it out.

Hello everyone!

I don't know if somebody met this issue before but I see the custom controls might have a problem with the alignment with some font-families. Here is an example of "monospace":

Forms · Bootstrap

This extra property should help with it.

.custom-control-label {
    line-height: $font-size-base * $line-height-base;
}

Forms · Bootstrap (1)

I have detected in V4.5 that it is not the only problem; even if we want to place the checkbox in the same row as an input or a Label of normal dimensions; it turns out that the checkbox goes crazy and does not align vertically or horizontally in the markup:

https://stackoverflow.com/questions/64579724/bootstraps-v4-5-checkbox-cannot-be-aligned-horizontally-or-vertically-when-next

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamov picture kamov  Â·  3Comments

ziyi2 picture ziyi2  Â·  3Comments

knownasilya picture knownasilya  Â·  3Comments

alvarotrigo picture alvarotrigo  Â·  3Comments

cvrebert picture cvrebert  Â·  3Comments