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
  • !20930

Add "text-top" vertical align

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/Bamieh/patch-1 into v4-dev Oct 18, 2016
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: Bamieh

Issue

Placing two inline-blocked divs next to each other will cause the second div to align in the middle of the first one, resulting in a step-like alignment of divs.

Reason

The next div in the inline-block'ed elements will inherit the vertical-align of the div previous to it, which is usually middle. resulting in this step-like alignment.

Solution

Adding "text-top" to the .d-inline-block class will solve this issue, as all divs placed by each other will take from this inline-block.

Side note

Although this issue is usually avoided by using bootstrap's grid system, sometimes developers need to place two elements next to each other without the grid system (or inside it) hence this will solve a kind of mysterious behavior for most developers.

Example

http://jsfiddle.net/bLcqLo5L/

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Bamieh/patch-1