Allow browsers to determine embedded media dimensions based on the width of their containing block by creating an intrinsic ratio that will properly scale on any device.
Rules are directly applied to
<object> elements; optionally use an explicit descendant class
.embed-fluid-item when you want to match the styling for other attributes.
Pro-Tip! You don’t need to include
frameborder="0" in your
<iframe>s as we override that for you.
<div class="embed-fluid embed-fluid-16x9"> <iframe class="embed-fluid-item" src="https://www.youtube.com/embed/MbGkL06EU90?rel=0" allowfullscreen></iframe> </div>
<div class="embed-fluid"> <video poster="/assets/video/niagara_falls.jpg" controls> <source src="/assets/video/niagara_falls.mp4"> <track src="/assets/video/niagara_falls-en.vtt" label="English" kind="subtitles" srclang="en" default /> </video> </div>
By default the aspect ratio is set to 16:9, this can be customized by overriding the
$embed-ratio settings variable. Also, the aspect ratios can be customized with the included modifier classes.