logo图片
Bootstrap教程

Bootstrap 响应式助手

Bootstrap 响应式助手

响应性帮助程序实用程序允许浏览器根据其包含块的宽度来确定视频或幻灯片的尺寸,从而可以在任何设备上正确缩放。
您必须直接在<iframe>, <embed>, <video>和<object>元素上应用规则;要与其他属性的样式匹配时,可以选择使用显式后代.embed-response-item。
注意: 您无需在<iframe>中包含frameborder="0",因为我们会为您覆盖它。
语法:
<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="//www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
You can customize aspect ratios with modifier classes:
<!--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>

响应性浮动

这些实用程序类用于使用CSS float属性根据当前视口的大小向左或向右浮动元素,或禁用浮动。包括!important以避免特异性问题。
它们使用与网格系统相同的视口宽度断点。
也可以使用两种类似的无响应Sass mixins(向左浮动和向右浮动)。
语法:
<div class="float-left">float left on all viewport sizes</div><br>
<div class="float-right">float right on all viewport sizes</div><br>
<div class="float-none">Don't float on all viewport sizes</div><br>
<div class="float-sm-left">float left on viewports sized SM (small) or wider</div><br>
<div class="float-md-left">float left on viewports sized MD (medium) or wider</div><br>
<div class="float-lg-left">float left on viewports sized LG (large) or wider</div><br>
<div class="float-xl-left">float left on viewports sized XL (extra-large) or wider</div><br>
使用方法:
// Related simple non-responsive mixins
.element {
  @include float-left;
}
.another-element {
  @include float-right;
}

昵称: 邮箱:
Copyright © 2020 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4