Jump to content

Anchor links scroll too far

Recommended Posts

Site URL: https://www.blackfishgoldstudios.com

I've designed a single-page / scroll website with anchor links that jump to page content in the always-present mobile menu. These links are held in the header of each section. When selected from the menu, the page jumps past the selected header and into the section content. Is there a way to make the jump more precise?

I've already tried adding a <span> above the header with the id placed therein. That did not alter the issue.

Much appreciated in advance!

Link to comment
  • Replies 7
  • Views 8k
  • Created
  • Last Reply
  • 6 months later...

Hi! This solution does not work for me. Please help!

https://berkshireic-cms.squarespace.com/clients-services-fees 

password: BIC2021

 

Pinned sticky header using Tuanphan's code:

.Header.Header--top {
    position: sticky;
    position: -webkit-sticky;
    top: 0px;
    z-index: 1000;
    width: 100%; }

 

Using this from the previous solution does not work for me: 

:target:before {
content:"";
display:block;
height:120px; /* fixed header height*/
margin:-120px 0 0; /* negative fixed header height */
}

Link to comment
On 5/12/2021 at 10:21 PM, kcasey said:

Hi! This solution does not work for me. Please help!

https://berkshireic-cms.squarespace.com/clients-services-fees 

password: BIC2021

 

Pinned sticky header using Tuanphan's code:

.Header.Header--top {
    position: sticky;
    position: -webkit-sticky;
    top: 0px;
    z-index: 1000;
    width: 100%; }

 

Using this from the previous solution does not work for me: 

:target:before {
content:"";
display:block;
height:120px; /* fixed header height*/
margin:-120px 0 0; /* negative fixed header height */
}

Hi. Where is anchor links?

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

Archived

This topic is now archived and is closed to further replies.

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