互動性
用於控制元素捲動行為的 Utility。
Class | 樣式 |
---|---|
scroll-auto | scroll-behavior: auto; |
scroll-smooth | scroll-behavior: smooth; |
使用 scroll-smooth
Utility 啟用元素內的平滑捲動。
<html class="scroll-smooth"> <!-- ... --></html>
設定 scroll-behavior
只會影響由瀏覽器觸發的捲動事件。
使用 scroll-auto
Utility 還原為瀏覽器預設的捲動行為。
<html class="scroll-smooth md:scroll-auto"> <!-- ... --></html>