O'rnatish
Har qanday qurilmada o'lchaydigan ichki nisbatni yaratib, ota-onaning kengligidan kelib chiqqan holda sezgir video yoki slayd-shou o'rnatishlarni yarating.
Haqida
Qoidalar to'g'ridan-to'g'ri <iframe>
, <embed>
, <video>
va <object>
elementlarga qo'llaniladi; .embed-responsive-item
ixtiyoriy ravishda boshqa atributlar uchun uslubni moslashtirishni xohlasangiz, aniq avlod sinfidan foydalaning .
Pro-Tip! s ga kiritishingiz shart emas , chunki biz buni frameborder="0"
siz <iframe>
uchun bekor qilamiz.
Misol
<iframe>
Asosiy elementdagi kabi har qanday joylashtirishni .embed-responsive
tomonlar nisbati bilan o‘rab oling. Bu .embed-responsive-item
qat'iy shart emas, lekin biz buni rag'batlantiramiz.
<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>
Tomonlar nisbati
Tomonlar nisbatlarini modifikator sinflari bilan moslashtirish mumkin. Odatiy bo'lib, quyidagi nisbat sinflari taqdim etiladi:
<!-- 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>
ichida _variables.scss
siz foydalanmoqchi bo'lgan tomonlar nisbatlarini o'zgartirishingiz mumkin. Bu ro'yxatga misol $embed-responsive-aspect-ratios
:
$embed-responsive-aspect-ratios: (
(21 9),
(16 9),
(4 3),
(1 1)
) !default;