交互性
用于控制元素滚动行为的实用工具。
类名 | 样式 |
---|---|
scroll-auto | scroll-behavior: auto; |
scroll-smooth | scroll-behavior: smooth; |
使用 scroll-smooth
实用工具来启用元素内的平滑滚动
<html class="scroll-smooth"> <!-- ... --></html>
设置 scroll-behavior
只会影响由浏览器触发的滚动事件。
使用 scroll-auto
实用工具来恢复为浏览器的默认滚动行为
<html class="scroll-smooth md:scroll-auto"> <!-- ... --></html>