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
  • #13325
Closed
Open
Issue created Apr 11, 2014 by Administrator@rootContributor

Negative margin on '.navbar-right:last-child' in Navbar is a miscalculation

Created by: aahan

Issue in: Navbar component

.navbar-nav.navbar-right:last-child {
  margin-right: -15px;
}

That's the CSS style applied on the right-floating menu items' container. It does its intended job only as long as there's only one <element class=" ... navbar-right"> in the Navbar. Add another and it messes the spacing of the last container ("last" not in HTML but in the order of appearance in browser, considering it's float: right;).

The Dashboard example template has the necessary items to reproduce the issue. Take a look at the snapshots, they should be self-explanatory.

Screenshot (1) Screenshot (2) Screenshot (3)

I am not saying margin-right: -15px; is wrong. It's needed, but doesn't suit all cases like I clearly explained. Manually adding a class like .last-child on the element itself is probably the way to go, but what do I know!

Assignee
Assign to
Time tracking