Last active
April 15, 2016 16:50
-
-
Save tylerforret/b8708ae1f59853505ba4 to your computer and use it in GitHub Desktop.
CSS solution for jump/anchor link style menus with a fixed header that causes the jump to go to the wrong spot on the page.
This file contains hidden or 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
h2:before { | |
display: block; | |
content: " "; | |
margin-top: -70px; /*adjust based on fixed header size*/ | |
height: 70px; /*adjust based on fixed header size*/ | |
visibility: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The name attribute is not supported in HTML5. Use the id attribute instead.
Just using h2 as an example. Works with any tag.