Created
November 6, 2013 16:13
-
-
Save csknk/7338971 to your computer and use it in GitHub Desktop.
CSS code for responsive video
This file contains hidden or 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
| /**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