Jump to content

Help with Anchor Links / Blog Jump links not working quite right.

Go to solution Solved by tuanphan,

Recommended Posts

Hi Hoping someone can advise, 

I am drafting a new blog and wanted to create a "table of contents" that readers can jump to a specific section on the page.

I found a 3 step code to do this through https://mishkinart.com/blog/squarespace-table-of-contents/

1. CSS CODE [see attached screen shot from website above]

2. ANCHOR LINKS [see attached screen shot from website above]

3. HTML CODE [see attached screen shot from website above]

I was able to set everything up. BUT... 

When I click the table of content item, it jumps down the blog BUT past the actual item title, so you have to scroll back up to see the item title. 

Here is the link to the blog post so you can see how it's jumping past the item. 

https://www.jennbutterworthinteriors.com/blog/multi-purpose-magic-creating-versatile-rooms-in-small-spaces-taz36#storage

Any advice or help as to how to tweak so that the jump link takes you to the title on the blog page would be very much appreciated. 

Thanks 

Jenn

 

 

 

CSS CODE.png

Anchor Links.png

HTML CODE.png

Edited by JBint
Link to comment
  • JBint changed the title to Help with Anchor Links / Blog Jump links not working quite right.
  • Replies 2
  • Views 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Hi,

Because your header is sticky on scroll, it partially covered the top of the screen, you can consider disable sticky header on blog posts only, or on blog post where you use anchor links (If you want this, you can use below code). Code should be at Website > Website Tools (under Not Linked) > Custom CSS

/* disable blog posts header sticky */
body[class*="type-blog"].view-item header#header {
    position: absolute !important;
}

But another way, you can follow this guide to fix that problem

https://www.will-myers.com/articles/perfect-anchor-links-in-squarespace

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.