From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Embeds

Embeds - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Embeds

- [Instructor] Embeds are pieces of code that you can add from other websites. For example, when you want to import a YouTube video into your projects, or perhaps add a codepen, you copy and paste some code into your html. However, the problem is that they don't always display properly in Bootstrap, and so you can format them by adding some responsive classes. What you do is create a container around the embed and you give that container a class of embed-responsive. And then in addition to the embed-responsive class, you add an embed-responsive and then a size class. And this is really an aspect ratio of the proportions of the thing that you're embedding. So you can use any of these different labels here. So you can say embed-responsive 16 by nine, et cetera, et cetera. In addition to that, you can add an embed-responsive item directly into the iframe or whatever else you're using, but it's not required, so this is sort of an optional thing. Let's take a look at how the code works. So…

Contents