Last active
July 27, 2022 07:41
-
-
Save ellegaarddk/2a61005d2354fd806b7d920fb539e645 to your computer and use it in GitHub Desktop.
Keeping anchor point below sticky header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** better solution | |
* description on https://wp-pro.dk/?p=3656 | |
**/ | |
:target { scroll-margin-top:75px} | |
/** old solution - don't use this! **/ | |
body:not(.elementor-editor-active) /* for not messsing up elementor editor */ | |
*[id]:before { | |
content: ""; | |
display:block; | |
height: 150px; /* fixed header height*/ | |
margin: -150px 0 0; /* negative fixed header height */ | |
visibility: hidden; | |
pointer-events: none; | |
z-index: -1; /* This prevents any links being behind the offset block and un-clickable */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment