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

使用這些輔助程式快速設定元素位置。

固定頂端

將元素置於視窗頂端,從邊緣到邊緣。請務必了解固定位置在專案中的影響;您可能需要新增其他 CSS。

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

固定底部

將元素置於視窗底部,從邊緣到邊緣。請務必了解固定位置在專案中的影響;您可能需要新增其他 CSS。

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

黏著頂端

將元素置於視窗頂端,從邊緣到邊緣,但僅在您捲動通過它之後。

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

回應式黏貼頂端

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

黏貼底部

將元素置於視窗底部,從邊緣到邊緣,但僅在您捲動通過它之後。

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

回應式黏貼底部

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