Container for embedded content (16:9 aspect ratio) in Bootstrap


Use the .embed-responsive class in Bootstrap to set a container for embedded content.

For 16:9 aspect ratio for the embedded content, use the embed-responsive-16by9 class

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "container">
         <h2>Eclipse Refactoring</h2>
         <p>To refactor code in Eclipse, try the below given steps in the video:</p>
         <div class = "embed-responsive embed-responsive-16by9">
            <iframe class = "embed-responsive-item" src = "https://www.youtube.com/embed/YFVV6RAUnNg "></iframe>
         </div>
      </div>
   </body>
</html>

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 12-Jun-2020

242 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements