Created
October 10, 2015 06:45
-
-
Save nfreear/fe9e706b602960a76da3 to your computer and use it in GitHub Desktop.
Bootstrap's embed-responsive | http://getbootstrap.com/components/#responsive-embed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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