Advertisement
onejdc

Responsive YouTube Embed

Mar 24th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.47 KB | None | 0 0
  1. <style>
  2. .embed-container {
  3.     position: relative;
  4.     padding-bottom: 56.25%;
  5.     padding-top: 30px;
  6.     height: 0;
  7.     overflow: hidden;
  8.     max-width: 100%;
  9.     height: auto;
  10. }
  11. .embed-container iframe, .embed-container object, .embed-container embed {
  12.     position: absolute;
  13.     top: 0;
  14.     left: 0;
  15.     width: 100%;
  16.     height: 100%;
  17. }
  18. </style>
  19. <div class='embed-container'>
  20.     <iframe src='http://www.youtube.com/embed/dQw4w9WgXcQ' frameborder='0' allowfullscreen></iframe>
  21. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement