Source

Embeds

Nggawe video responsif utawa slideshow embeds adhedhasar jembaré wong tuwa kanthi nggawe rasio intrinsik sing timbangan ing piranti apa wae.

Babagan

Aturan langsung ditrapake kanggo <iframe>, <embed>, <video>, lan <object>unsur; opsional nggunakake kelas turunan eksplisit .embed-responsive-itemyen sampeyan pengin cocog gaya kanggo atribut liyane.

Pro-Tip! Sampeyan ora perlu kanggo kalebu frameborder="0"ing <iframe>s minangka kita override sing kanggo sampeyan.

Tuladha

Bungkus sembarang embed kaya <iframe>ing unsur induk karo .embed-responsivelan rasio aspek. Iki .embed-responsive-itemora dibutuhake, nanging kita nyengkuyung.

<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>

Rasio aspek

Rasio aspek bisa disesuaikan karo kelas modifier.

<!-- 21:9 aspect ratio -->
<div class="embed-responsive embed-responsive-21by9">
  <iframe class="embed-responsive-item" src="..."></iframe>
</div>

<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="..."></iframe>
</div>

<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
  <iframe class="embed-responsive-item" src="..."></iframe>
</div>

<!-- 1:1 aspect ratio -->
<div class="embed-responsive embed-responsive-1by1">
  <iframe class="embed-responsive-item" src="..."></iframe>
</div>