Forum Discussion
yellowjacket9
Jul 13, 2022Copper Contributor
Anchor Links Not Working
Hi, I am having an issue where anchor linking works fine right after I create the link but as soon as I reload the page, it stops working. I can visibly see the URL changing correctly but the user is not taken to the heading. Any help would be much appreciated.
- TCormackCopper Contributor
I found a solution on another site that worked for me: The Incredibly Easy No-Code Solution to Simple Anchor Tags in SharePoint Navigation | Customer and Employee Engagement Blog (c5insight.com)
Solution is: When you link to your page and anchor, just add the question mark in front of the anchor tag like:
https://contoso.sharepoint.com/sites/subsite/sitepages/page.aspx?#anchor
- Beth-GreenCopper ContributorThank you for posting this solution!
- Bharath ArjaIron ContributorWorking fine when i tested in Chrome & Edge. Are you linking to a section in a different page or same page? May be bad cache? Give it a try after clearing browser cache.
- yellowjacket9Copper ContributorIt's linking to the same page. I just cleared my cache and the issue persists. For clarity, the URL for the anchor link should just be the URL for the page with the following appended?
'#Header'- Bharath ArjaIron ContributorYes, that's correct. URL for the page followed by #Header.
You might have already done this but make sure your Header text is tagged as Heading # HTML text type.