How Do I Make Sure An iFrame's Aspect Ratio Is Responsive?
问题 I have a very simple question. How do I make sure an iframe's aspect ratio is responsive? The iframe is a YouTube Video, and I want the aspect ratio of the iframe to remain 16:9 no matter the browser window size. Here is my current code for mobile devices: @media screen and (max-width: 600px) { iframe, body { max-width: 90vw; height: auto; } } iframe { border: 0; width: 600px; height: 338px; } Because YouTube iframes do not keep aspect ratio automatically, I need a way to keep the aspect