为什么 SharePoint 2010 中的空白页面顶部锚点不起作用?

发布于 2024-10-10 09:32:44 字数 335 浏览 0 评论 0原文

在标准 SharePoint 发布网站中,编辑主页、输入大量内容,然后使用以下锚链接将链接放置到页面顶部是行不通的:

<a href="#">back to top</a>

单击上面的链接不会执行任何操作。然而,其他命名的锚点(例如

<a name="test"></a> 

和 )

<a href="#test"></a>

工作正常。

以前有人遇到过这个问题吗?

Within a standard SharePoint publishing site, editing the homepage, entering lots of content and then placing a link to the top of the page using the following anchor link doesn't work:

<a href="#">back to top</a>

Clicking on the link above does nothing. However, other named anchors (such as

<a name="test"></a> 

and

<a href="#test"></a>

work fine.

Has anyone come across this issue before?

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

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

发布评论

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

评论(2

太阳男子 2024-10-17 09:32:44

不是应该将您带到页面顶部。它以空片段为目标,并且基本上在大多数情况下中和链接的默认行为。

我怀疑您的 解决方案依赖于浏览器的工件,因为名为 # 的锚应该称为 # #(或更可能是#%23)位于链接的href 属性中。

由于无论如何您都必须创建锚点,因此最好为其指定一个有意义的名称,例如 TOP 并使用 back to top< /a>

<a href="#" /> is not supposed to bring you to the top of the page. It targets the empty fragment and basically neuters the default behavior of the link most of the time.

I suspect your <a name="#" /> solution is relying on an artifact of your browsers, because an anchor named # should be called ## (or more probably #%23) in the href attribute of the link.

Since you have to create an anchor anyway, it might be best to give it a meaningful name like TOP and target it using <a href="#TOP">back to top</a>.

别在捏我脸啦 2024-10-17 09:32:44

我已经通过将其放置在页面顶部来解决它

<a name="#"></a>

,但最好找出它不能正常工作的原因,以及是否有其他更好的解决方案。

I've gotten around it by placing

<a name="#"></a>

at the top of the page, but it would be good to find out why it doesn't work normally, and if there are any other nicer solutions out there.

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