Skip to content

Instantly share code, notes, and snippets.

@csknk
Created November 6, 2013 16:13
Show Gist options
  • Select an option

  • Save csknk/7338971 to your computer and use it in GitHub Desktop.

Select an option

Save csknk/7338971 to your computer and use it in GitHub Desktop.
CSS code for responsive video
/**Put video embeds in this div for responsive behaviour**/
.video_wrapper {
position: relative;
padding-bottom: 74.25%; /* for a 4:3 aspect ratio */
/* change padding-bottom to : 56.25% for 16:9 ratio, 50% for 16:10 ratio */
padding-top: 30px;
height: 0;
overflow: hidden;
margin-bottom: $MainPad;
}
.video_wrapper iframe,object,embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment