为什么 SharePoint 2010 中的空白页面顶部锚点不起作用?
在标准 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不是应该将您带到页面顶部。它以空片段为目标,并且基本上在大多数情况下中和链接的默认行为。
我怀疑您的
解决方案依赖于浏览器的工件,因为名为
#
的锚应该称为# #
(或更可能是#%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 thehref
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>
.我已经通过将其放置在页面顶部来解决它
,但最好找出它不能正常工作的原因,以及是否有其他更好的解决方案。
I've gotten around it by placing
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.