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
  • Issues
  • #20106
Closed
Open
Issue created Jun 10, 2016 by Administrator@rootContributor

Incorrect `margin-left` and `margin-right` on `.row`-class when using odd `@grid-gutter-width`

Created by: malthejorgensen

Steps to reproduce

  1. Choose an odd @grid-gutter-width, e.g. @grid-gutter-width: 15px
  2. Compile bootstrap Less-stylesheets

Problem The left and right margin .row class, which should normally "cancel out" the left and right padding of the .col-*-* classes is actually flipped so that instead cancelling out, there's a one pixel difference between the two:

.row {
  margin-left:  -7px; /* should be -8px */
  margin-right: -8px; /* should be -7px */
}

.col-md-12 {
  padding-left:  8px;
  padding-right: 7px;
}

Reason The reason why this happens is that in .row the ceil() and floor()-functions are used on negative numbers: margin-left: ceil(-7.5px) == -7px, as opposed to the .col-*-*-classes where it's used in a standard way on positive numbers: padding-left: ceil(7.5px) == 8px, which ends up giving the one pixel difference. As ceil()/floor() rounds towards negative/positive infinity, rather than towards/away from zero.

The bug was introduced with the fix for: https://github.com/twbs/bootstrap/issues/16281

Assignee
Assign to
Time tracking