chrisstump
2/12/18 at 5:21 pm
HTML
youtube, responsive
Responsive Video Embed
Use the corresponding markup and CSS to create a responsive video frame for embedded YouTube videos.
.video-wrapper { position: relative; padding-bottom: 56.25%; /* 16:9 */ padding-top: 25px; height: 0; margin-bottom: 20px; } .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
Copy Snippet to Clipboard
Don't Have an Account?
Stop digging through old code examples. Get organized. Get Code Snipper.
Learn More
Start Free 14 Day Trial