Guest Posted May 12, 2021 Posted May 12, 2021 (edited) Site URL: https://berkshireic-cms.squarespace.com I'm trying to add anchor links to my site, but am running into issues with the link landing below the corresponding anchor due to sticky navigation. I'm in Brine, 7.0 and, while I know this particular feature is possible via other methods in 7.1, that is not a possibility here. Can anyone help with this? Thank you! You can see an example on this page: https://berkshireic-cms.squarespace.com/clients-services-fees password: BIC2021 Pinned sticky header using Tuanphan's code from a previous post: .Header.Header--top { position: sticky; position: -webkit-sticky; top: 0px; z-index: 1000; width: 100%; } Tried this solution offered in previous post by a Wordpress user. Some folks had success with this, but it does not work for me: :target:before {content:"";display:block;height:120px; /* fixed header height*/margin:-120px 0 0; /* negative fixed header height */ } Edited May 12, 2021 by Guest
tuanphan Posted May 14, 2021 Posted May 14, 2021 Hi. It looks fine here. Did you solve the problem? 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!)
mechatroner Posted December 26, 2021 Posted December 26, 2021 I was having a similar page-positioning problem on a page with a fixed header and the ":target:before..." solution wasn't working for me either. (I'm using the Bedford template in Squarespace 7.0) What did end up working was to specify a class in the target <p> element and then to use CSS to define the class for that particular class. eg. in a code block on the page add a class name to the <p> element:: <p id="reference1" class="linktarget">Reference 1</p> and in css define the properties of the "linktarget" class: .linktarget:before { content:""; display:block; height:120px; /* the height of the fixed header*/ margin:-120px 0 0; /* the negative of the fixed header height */ } This solution is based on the "Fixed Header Solution" described here: https://www.minddevelopmentanddesign.com/blog/link-an-anchor-tag-target-location-different-page-expanded-content-fixed-header/ I hope this information is helpful to someone.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment