If you are going to look on the code, I’ve added to the wrapper a positioning that is relative, padding on the bottom of 56.10%, height of 0 and a hidden overflow. Add the CSS properties below to make the embedded iframe responsive. This is where the iframe is adjusted proportionally. In my case, I change the default width of 420 to 730 and its height from 315 to 548. You can change your maximum width and height according to your preferences. įirst thing to do to make it responsive according to ratio, add a simple markup using tag. The video is adjusting normally but the iframe’s height is not adapting to its video size. I remember when I have created a site which uses an iframe from YouTube embeds, responsiveness of it is not working properly. If you want to add your maximum video size, you can adjust its width and height according to your preferences. Today, I will share my experience on how I have learned to make an iframe responsive for YouTube embeds. Please take note that you don’t have to remove the width and height properties for this. The Markup for Responsive Iframeīy default if you are going to embed YouTube videos, you will find an iframe on it, like the example below. I have written a simple solution for it using a simple CSS techniques. Oh, it hurts! How can I actually make it fully responsive making it proportionally adjusts according to screen sizes? Well, I have learned to make it work. Take for example the embedded iframe YouTube video below. It points me to realize that iframes by default is not fully responsive in screen sizes. Like me whenever I sit and work for a web design, I learn new things. Today, I will share my experience on how I have learned to make an iframe responsive for YouTube embeds. Web designers and developers often experience challenges every day.