Home / Articles / HTML5 & CSS3 Articles / Responsive iframes. Launching the CI/CD and R Collectives and community editing features for How to make Twitter Bootstrap menu dropdown on hover rather than click. sized thanks to our universal selector .ratio > *. Change the width of its parent and itll change the size while keeping the same shape (aka. Source Share Follow answered Dec 11, 2019 at Dont forget to lazy-load your iframes. Either way, you'll have a little more data to help decipher the problem. The only way is to either manually apply the correct aspect ratio or use a JS solution to get the aspect and then adjust when the screen resizes. sorry let me clarify, the iframe embeds but it is not responsive, and i get a massive pad on the bottom. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Your email address will not be published. Heres a list of other aspect ratio percentages you can use when defining padding-top. Author: Ivan Grozdic . Responsive iframes The Right Way (CSS Only)! rev2023.3.1.43266. These options let you decide whether youd like to display all of your questions on one page, or simply show one question per screen. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. Post your questions, comments, or suggestions in the comments below. I have huge black bars on either side of the video that I cant seem to get rid of by various means. I've had the same problem and solved it by adding a row and col-sm-8 (according to what size you'd like) around the .embed-responsive div.
, and add the iframe inside of it: Example