in English

Awọn ifibọ

Ṣẹda fidio idahun tabi awọn ifibọ agbelera ti o da lori iwọn ti obi nipa ṣiṣẹda ipin inu inu ti o ni iwọn lori eyikeyi ẹrọ.

Nipa

Awọn ofin lo taara si <iframe>, <embed>, <video>, ati <object>awọn eroja; ni yiyan lo kilasi irandiran ti o fojuhan .embed-responsive-itemnigba ti o ba fẹ lati baramu iselona fun awọn abuda miiran.

Pro-Imọran! O ko nilo lati ṣafikun frameborder="0"ninu <iframe>s rẹ bi a ṣe bori iyẹn fun ọ.

Apeere

Fi ipari si eyikeyi ifibọ bi ohun <iframe>ni a obi ano pẹlu .embed-responsiveati awọn ẹya aspect ratio. Awọn .embed-responsive-itemti wa ni ko muna muna, sugbon a gba o niyanju.

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

Awọn ipin abala

Awọn ipin abala le jẹ adani pẹlu awọn kilasi modifier. Nipa aiyipada awọn kilasi ipin wọnyi ti pese:

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

Ninu _variables.scss, o le yi awọn ipin abala ti o fẹ lati lo. Eyi ni apẹẹrẹ ti $embed-responsive-aspect-ratiosatokọ:

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