Skip to content

Instantly share code, notes, and snippets.

@alyssachk
Created September 24, 2016 17:02
Show Gist options
  • Save alyssachk/6737c7a3c2a4a44215374a1e710f3565 to your computer and use it in GitHub Desktop.
Save alyssachk/6737c7a3c2a4a44215374a1e710f3565 to your computer and use it in GitHub Desktop.
Allow browsers to determine video or slideshow dimensions based on the width of their containing block by creating an intrinsic ratio that will properly scale on any device.
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment