How to make iframe Responsive in Bootstrap ? Last Updated : 01 May, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report A responsive iframe in Bootstrap refers to embedding an iframe within a container that adjusts its size and aspect ratio based on the screen size, ensuring proper display and usability across various devices and viewports. ApproachIn this approach, we are using Bootstrap's Embed Responsive Classes. Bootstrap provides embed-responsive classes to make embedded content, including iframes, responsive. You can use classes like embed-responsive and embed-responsive-16by9 to maintain aspect ratios. Also, the embed-responsive-item class is applied to the iframe element within the .embed-responsive container. It ensures that the iframe maintains the aspect ratio specified by the parent container. Syntax:<div class="embed-responsive embed-responsive-16by9"> <iframe class="embed-responsive-item" src="video url" allowfullscreen></iframe> </div>Note: 16by9 is the aspect ratio of the content which can be 21by9, 4by3, or 1by1 as well. Example: embed-responsive class is used for creating responsive embeds, such as videos or iframes. It maintains the aspect ratio of the content regardless of the screen size and the embed-responsive-4by3 class specifies the aspect ratio of the embedded content. HTML <!DOCTYPE html> <html> <head> <title>GFG</title> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- Bootstrap CSS --> <link rel="stylesheet" href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity= "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> </head> <body> <h1 class="text-center text-success"> GeeksforGeeks </h1> <div class="embed-responsive embed-responsive-4by3"> <iframe class="h-50 embed-responsive-item" src= "https://www.youtube.com/embed/zbBALFXGy4Y" allowfullscreen> </iframe> </div> </body> </html> Output: responsive iframe in Bootstrap Example Output Comment More infoAdvertise with us Next Article How to make iframe Responsive in Bootstrap ? B bishalpaul34 Follow Improve Article Tags : Web Technologies Bootstrap Bootstrap-Questions Similar Reads How to make Text Responsive in Bootstrap ? Making text responsive in Bootstrap involves using responsive typography utilities like .text-sm, .text-md, etc., to ensure text adapts to different screen sizes. This ensures readability and maintains visual hierarchy across devices. Below are the approaches to making text responsive in Bootstrap: 3 min read How to make Responsive Carousel in Bootstrap ? Bootstrap Responsive Carousel simplifies the creation of responsive carousels for dynamic content display. Utilize the Carousel component with a suitable HTML structure, ensuring proper sizing and responsive breakpoints for optimal display across devices. ApproachCreate an HTML document with Bootstr 2 min read How to make Form Responsive using Bootstrap ? We are going to create a responsive form by using Bootstrap 5. responsiveness is a feature that allows users to interact with the web app on any device easily. It helps to create better UI interactions and a better user experience that can be a reason to have great traffic on the respective website. 4 min read Bootstrap 5 Images Responsive images Bootstrap 5 Responsive images are used to resize the images according to their parent element and screen sizes. It means, the size of the image should not overflow its parent element and will grow and shrink according to the change in the size of its parent without losing its aspect ratio.Responsive 1 min read How to make images responsive ? In today's world, mobile internet usage is growing at a fast pace, so it has become necessary for websites to have responsive designs for devices of different sizes. Websites that can change their appearance dynamically according to the device or the screen in which it is viewed are called responsiv 3 min read Like