Skip to content

Instantly share code, notes, and snippets.

@robinbastien
Created March 29, 2016 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinbastien/4906e52c0f0810a792870a0c73fdb426 to your computer and use it in GitHub Desktop.
Save robinbastien/4906e52c0f0810a792870a0c73fdb426 to your computer and use it in GitHub Desktop.
A fix for linking to sections with anchors while having a 'sticky' header
.someselector[id]::before {
display: block;
content: "";
width: 1px;
visibility: hidden;
pointer-events: none;
/* Set both heights to the same, adjust as needed */
height: 11rem;
margin-top: -11rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment