Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created October 10, 2015 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfreear/fe9e706b602960a76da3 to your computer and use it in GitHub Desktop.
Save nfreear/fe9e706b602960a76da3 to your computer and use it in GitHub Desktop.
<!doctype html> <title> Bootstrap's embed-responsive </title>
<style>
body { margin: 0 auto; max-width: 50em; color: #333; font: 1em sans-serif; }
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
.embed-responsive-16by9 {
padding-bottom: 56.25%;
}
.embed-responsive-4by3 {
padding-bottom: 75%;
}
</style>
<h1> Bootstrap's <tt>embed-responsive</tt> </h1>
<div class="embed-responsive embed-responsive-16by9">
<iframe src="http://embed.open.ac.uk/embed/-/youtube.com/0rj_td9wwbI#" allowfullscreen ></iframe>
</div>
<pre>
Nick Freear, 10 October 2015.
* https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css#L5791-L5816
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment