1 | initial version |
To create a responsive iframe with a video embedded in it, you can follow these steps:
<div class="video-container">
<iframe src="your-video-source-url" frameborder="0" allowfullscreen></iframe>
</div>
.video-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
That's it! Your video iframe should now be responsive and fit any screen size.