Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以给 body 元素一个 css 参数,告诉它默认滚动到某个点吗?例如,类似:
body { default-scroll-y: 200px; }
如果没有,是否有另一种方法可以将滚动距离描述为 CSS 中的高度?
CSS中没有办法。您可以使用 JavaScript/jQuery 触发它。 您可以为此使用插件:
或者自己实现它,我猜这不会很难。