1

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?

Henry C
  • 4,781
  • 4
  • 43
  • 83

2 Answers2

2

<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>.

Community
  • 1
  • 1
Frédéric Hamidi
  • 258,201
  • 41
  • 486
  • 479
0

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.

Henry C
  • 4,781
  • 4
  • 43
  • 83