跳至主要內容 跳至文件導覽

定位(Position)

使用這些輔助類別快速設定元素的定位。

Fixed top

將元素定位在視窗頂部,從邊緣到邊緣。請確保您了解固定定位在您專案中的影響;您可能需要新增額外的 CSS。

<div class="fixed-top">...</div>

Fixed bottom

將元素定位在視窗底部,從邊緣到邊緣。請確保您了解固定定位在您專案中的影響;您可能需要新增額外的 CSS。

<div class="fixed-bottom">...</div>

Sticky top

將元素定位在視窗頂部,從邊緣到邊緣,但只有在捲動經過它之後才生效。

<div class="sticky-top">...</div>

響應式 sticky top(Responsive sticky top)

.sticky-top 通用類別也有響應式變體。

<div class="sticky-sm-top">Stick to the top on viewports sized SM (small) or wider</div>
<div class="sticky-md-top">Stick to the top on viewports sized MD (medium) or wider</div>
<div class="sticky-lg-top">Stick to the top on viewports sized LG (large) or wider</div>
<div class="sticky-xl-top">Stick to the top on viewports sized XL (extra-large) or wider</div>
<div class="sticky-xxl-top">Stick to the top on viewports sized XXL (extra-extra-large) or wider</div>

Sticky bottom

將元素定位在視窗底部,從邊緣到邊緣,但只有在捲動經過它之後才生效。

<div class="sticky-bottom">...</div>

響應式 sticky bottom(Responsive sticky bottom)

.sticky-bottom 通用類別也有響應式變體。

<div class="sticky-sm-bottom">Stick to the bottom on viewports sized SM (small) or wider</div>
<div class="sticky-md-bottom">Stick to the bottom on viewports sized MD (medium) or wider</div>
<div class="sticky-lg-bottom">Stick to the bottom on viewports sized LG (large) or wider</div>
<div class="sticky-xl-bottom">Stick to the bottom on viewports sized XL (extra-large) or wider</div>
<div class="sticky-xxl-bottom">Stick to the bottom on viewports sized XXL (extra-extra-large) or wider</div>