Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !28711

Align checkboxes & radios

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge master-mc-checkbox-radio-align into master May 01, 2019
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 5

Created by: MartijnCuppens

Cross browser aligning checkboxes and radios is hard because every browser seems to have different widths/height and align possibilities. This misaligns our checkboxes and radios in different ways.

I found a solution for this by setting the height of the input to the line height. This won't stretch the input but instead align it to the middle of the element which will perfectly align checkboxes and radios in every browser.

The only disadvantage is that the line height will depend on the line height of the body, but I think that's fine in almost any situation. The current situation is way worse imo.

Before:

  • https://getbootstrap.com/docs/4.3/components/forms/#checkboxes-and-radios
  • https://getbootstrap.com/docs/4.3/content/reboot/#forms
  • https://getbootstrap.com/docs/4.3/components/input-group/#checkboxes-and-radios

After

  • https://deploy-preview-28711--twbs-bootstrap.netlify.com/docs/4.3/components/forms/#checkboxes-and-radios
  • https://deploy-preview-28711--twbs-bootstrap.netlify.com/docs/4.3/content/reboot/#forms
  • https://deploy-preview-28711--twbs-bootstrap.netlify.com/docs/4.3/components/input-group/#checkboxes-and-radios

Closes #27755 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master-mc-checkbox-radio-align