Source

Embeds

Yenza ividiyo ephendulayo okanye umboniso wesilayidi usekwe kububanzi bomzali ngokwenza umlinganiselo ongaphakathi okala kuso nasiphi na isixhobo.

Malunga

Imigaqo isetyenziswa ngokuthe ngqo kwi <iframe>, <embed>, <video>, kunye <object>neziqalelo; ngokuzikhethela sebenzisa udidi lomzukulwana olucacileyo .embed-responsive-itemxa ufuna ukuthelekisa isimbo sezinye iimpawu.

Pro-Tip! Awudingi ukubandakanya frameborder="0"kwi- <iframe>s yakho njengoko sibhala ngaphezulu oko kuwe.

Umzekelo

Songa naluphi na uzinziso njengelungu <iframe>lomzali kunye .embed-responsivenomyinge womlinganiselo. Oku .embed-responsive-itemakufuneki ngokungqongqo, kodwa siyayikhuthaza.

<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>

Aspect ratios

Umyinge womlinganiselo unokwenziwa ngokweeklasi zesilungisi. Ngokungagqibekanga kubonelelwe ngezi klasi zilandelayo:

<!-- 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>

Ngaphakathi _variables.scss, ungatshintsha umlinganiselo wembonakalo ofuna ukuyisebenzisa. Nanku umzekelo $embed-responsive-aspect-ratioswoluhlu:

$embed-responsive-aspect-ratios: (
  (21 9),
  (16 9),
  (4 3),
  (1 1)
) !default;