Source

Nneɛma a wɔde hyɛ mu

Yɛ video anaa slideshow embeds a ɛyɛ mmuae a egyina ɔwofo no trɛw so denam intrinsic ratio a wobɛma ayɛ scales wɔ device biara so no so.

Fa ho

Wɔde mmara di dwuma tẽẽ wɔ <iframe>, <embed>, <video>, ne <object>nneɛma ahorow ho; sɛ wopɛ sɛ wode aseni adesuakuw a ɛda adi pefee di dwuma .embed-responsive-itembere a wopɛ sɛ wo ne styling no hyia ma su afoforo no.

Pro-Afotusɛm! Ɛho nhia sɛ wode ka frameborder="0"wo <iframe>s ho sɛnea yɛrebu saa asɛm no so ama wo no.

Nhwɛsoɔ

Wrap biara embed te sɛ an <iframe>wɔ ɔwofo element ne .embed-responsivene afã ratio. The .embed-responsive-itemisn’t strictly required, nanso yɛhyɛ ho nkuran.

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

Afã horow a wɔde di dwuma

Wobetumi de modifier adesua ahorow ayɛ afã nsusuwii ahorow no sɛnea wɔpɛ. Sɛnea wɔahyɛ no, wɔde ratio adesua ahorow a edidi so yi ama:

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

_variables.scss, mu no, wubetumi asesa afã horow a wopɛ sɛ wode di dwuma no. Nsɛm a wɔahyehyɛ no ho nhwɛso $embed-responsive-aspect-ratiosni:

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