Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Created October 31, 2012 14:02
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 maxxscho/3987183 to your computer and use it in GitHub Desktop.
Save maxxscho/3987183 to your computer and use it in GitHub Desktop.
Responsive embeded video
<!DOCTYPE html>
<!-- Add classes for each IE to the HTML Tag -->
<!--[if lt IE 7 ]><html class="ie ie6 no-js"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7 no-js"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8 no-js"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html class="no-js"> <!--<![endif]-->
<head>
<title>Responsive Video</title>
<meta charset="UTF-8"/>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<style type="text/css">
.elastic-video {
position: relative;
height: 0;
padding-bottom: 54%; /* Play with the percent between 50% and 60% too minimize the black borders */
padding-top: 15px;
overflow: hidden;
}
.elastic-video iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="container"><!-- your responsive container -->
<div class="elastic-video">
<iframe src="http://player.vimeo.com/video/27359051?byline=0&amp;portrait=0" width="610" height="343" frameborder="0"></iframe>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment