浮动(Float)

使用我们响应式的float通用类别,在任何断点上切换任何元素的浮动。

概述

这些通用类别使用CSS float属性基于目前的视窗大小而向左、向右或禁用浮动。并包含了!important以避免权重问题。float使用与网格系统相同的屏幕断点。请注意,浮动(float)通用类别对于使用flex的元件没有影响。

Float start on all viewport sizes

Float end on all viewport sizes

Don't float on all viewport sizes
<div class="float-start">Float start on all viewport sizes</div><br>
        <div class="float-end">Float end on all viewport sizes</div><br>
        <div class="float-none">Don't float on all viewport sizes</div>

响应式

每个float值都有响应式的变化:

Float start on viewports sized SM (small) or wider

Float start on viewports sized MD (medium) or wider

Float start on viewports sized LG (large) or wider

Float start on viewports sized XL (extra-large) or wider

<div class="float-sm-start">Float start on viewports sized SM (small) or wider</div><br>
        <div class="float-md-start">Float start on viewports sized MD (medium) or wider</div><br>
        <div class="float-lg-start">Float start on viewports sized LG (large) or wider</div><br>
        <div class="float-xl-start">Float start on viewports sized XL (extra-large) or wider</div><br>

以下是所有支持的类别:

  • .float-start
  • .float-end
  • .float-none
  • .float-sm-start
  • .float-sm-end
  • .float-sm-none
  • .float-md-start
  • .float-md-end
  • .float-md-none
  • .float-lg-start
  • .float-lg-end
  • .float-lg-none
  • .float-xl-start
  • .float-xl-end
  • .float-xl-none
  • .float-xxl-start
  • .float-xxl-end
  • .float-xxl-none

Sass

Utilities API

Float utilities are declared in our utilities API in scss/_utilities.scss.

    "float": (
        responsive: true,
        property: float,
        values: (
          start: left,
          end: right,
          none: none,
        )
        ),
        
返回顶部