使用锚点调用网站会破坏设计

发布于 2024-07-20 14:26:41 字数 361 浏览 4 评论 0原文

当我使用锚集 (...#xxx) 访问该网站时,顶部的图像会移到视口之外。

正常行为:http://soc.org/index.php?id=4
损坏的设计: http://soc.org/index.php?id=4#c272

顶部图像是绝对定位的。 谷歌分析代码后面有一些空行。 如果我删除它们,它就会起作用。

感谢您的任何建议!

When I access the site with an anchor set (...#xxx) the image on top is shifted outside the viewport.

Normal behaviour: http://soc.org/index.php?id=4
Corrupted design: http://soc.org/index.php?id=4#c272

The top image is positioned absolute.
There are some blank lines directly after the google-analytics code. If I delete them, it works.

Thanks for any suggestions!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香草可樂 2024-07-27 14:26:41

如果关闭div.upperPage 上的overflow:hidden ,就更容易看到发生了什么。

您可以看到锚点导致其内容滚动,而不是整个页面滚动。 但是,我不知道有任何规范规定哪些元素应该滚动才能实现锚定要求。

It's easier to see what's going on if you turn off the overflow:hidden on div.upperPage

You can see the anchor is causing the scroll on the contents of that, rather than on the page as a whole. However, I don't know of any specifications that state what elements should scroll to achieve the anchor requirement.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文