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

Fix .embed-responsive class in flex container

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ntkme/responsive-embed into master Apr 14, 2016
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: ntkme

This PR fixes a Firefox only problem that .responsive-embed will display incorrectly in a flex container, which causes embed items to disappear or overflow.

<div style="display: flex;">
  <div class="embed-responsive embed-responsive-16by9">
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/nzwFJcDhmdA" frameborder="0" allowfullscreen></iframe>
  </div>
</div>

Firefox ignores vertical percentage padding when the flex container lacks an explicit height. In this issue, Firefox developer says it is not a bug in Firefox. He claims that the implementation in all other major browsers is wrong.

For blocks in CSS, % padding values are always resolved against the containing block width -- but in flexbox, they're resolved against the length of the containing block's corresponding dimension (width or height). Spec reference: http://dev.w3.org/csswg/css-flexbox/#item-margins

An extra benefit from this PR is that user can now set an explicit width on embed-responsive without screwing the aspect ratio. Under the current implementation, it would require another wrapper to do so.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ntkme/responsive-embed